Sharing Variables Between Process

You want to a way to share information between processes that provides fast access to the shared data.

Posted on September 12, 2015 in PHP

Use the data store functionality of the APC extension, as shown in Following:


$population = apc_fetch('population');
$population += ($births + $immigrant - $deaths - $emigrants);
apc_store('population', $population);

If you don’t have APC available, use one of the two bundled shared memory extensions, shmop or System V shared memory.


comments powered by Disqus