<?php
// You will probably need to protect shared memory with other synchronization objects.
// Shared memory goes away when the last reference to it disappears.
$mem = new SyncSharedMemory("AppReportName", 1024);
if ($mem->first())
{
// Do first time initialization work here.
}
$result = $mem->write("report.txt");
$result = $mem->read(3, -4);
var_dump($result);
?>
El resultado del ejemplo
sería algo similar a: