Originally posted by yelvington
Put it in a database. Easy to read, easy to modify, scalable across multiple servers.
Thanks for the solution, but frankly, that would be the last thing i would do. Firstly, very cost effective, think of multiplying the access time by amount of pages requesting this variable from database (all, in my case, since they use the $debug for flagging debug code), and you have a highly unnecessary database communication.
all in all, the solution of having it declared and defined as a PHP variable in every page (by including a common header, say, debug.php) sounds the most reasonable in my circumstances...
Also, I would imagine the reasons behind lacking of application state - PHP could also be running as a CGI script, and those are cannot be state-machines.. In other words, there is no way for a CGI script to keep persistent state. Only client variables could do that, I guess, like cookies or something...
Anyway, thanks guys ! 🙂