I've encounter a problem with PHP to store intermediate result locally.
$ret = apc_fetch("foo");
apcu_store("foo", "bar", 0);
$ret = apcu_fetch("foo");
$shmKey = ftok(__FILE__, 't');
$shmId = shmop_open($shmKey, "c", 0644, 1024);
$dataArray = array("foo" => "bar");
shmop_write($shmId, serialize($dataArray), 0);
$retArray = unserialize(shmop_read($shmId, 0, shmop_size($shmId)));
$ret = $retArray['foo'];
Both APC and APCu share the memory across the same process they run in however you cannot use that with different processes. They intended to work on a prefork multiprocess or multithreaded applications (apache/php-fpm/etc).
The CLI version of APCu is there mostly to help with testing, but if you run a code using the CLI and then run another instance of the CLI - you will not have the data from your first run (the same will happen if you will restart your web server).
It's unfortunate that this information is not clear in the documentation.