I developed a PHP page with global variable like this;
global $amty_imgCache; $amty_imgCache = array();
$GLOBALS[\"amty_imgCache\"]=$amty_imgCache;
While I think most answers here are appropriate, I don't find them complete enough. PHP certainly has application-wide persistence only that you'd have to build such variables into PHP itself or a module that is loaded when PHP is first loaded by your web server. That means extending and rebuilding PHP itself or at least building and loading an external module.