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.