A
Anonymous
Guest
Just in case - global variables are not persistent across script executions, they are simply available to any method/class in that particular running instance of the script.
If you want to have something which remembers values across instances, you will need to look into some form of caching. You can try APC (a quick search of Google gives https://www.if-not-true-then-false.com/2012/php-apc-configuration-and-usage-tips-and-tricks/ ) which allows you to do what your after ( I think ). There are other caching methods - memcache, redis etc. and all have their own features and benefits/problems.
If you want to have something which remembers values across instances, you will need to look into some form of caching. You can try APC (a quick search of Google gives https://www.if-not-true-then-false.com/2012/php-apc-configuration-and-usage-tips-and-tricks/ ) which allows you to do what your after ( I think ). There are other caching methods - memcache, redis etc. and all have their own features and benefits/problems.