<?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");
var_dump($result);
$result = $mem->write("report.txt", -3);
var_dump($result);
?>
Yukarıdaki örnek şuna benzer bir çıktı üretir: