From: rayro at gmx dot de Operating system: Irrelevant PHP version: Irrelevant Package: Class/Object related Bug Type: Feature/Change Request Bug description:Creating own super globals
Description: ------------ It would be a nice feature to create super globals at runtime like $_SERVER or $_SESSION without making the use of extensions like "runkit". I think it was runkit that enables this feature, or am i wrong? Generally the "static" keyword is a good one to make this possible. It has currently no effect when using in global scope (no error, no warning, no notice). What about to use static for defining super globals? I think it is self-explaining to the people out there... Test script: --------------- <?php static $_SUPER = array('foo' => 'bar'); class A { function __construct() { echo($_SUPER['foo']); } } $obj = new A; ?> Expected result: ---------------- string(3) "bar" Actual result: -------------- Notice: Undefined variable: _SUPER in ... on line ... -- Edit bug report at https://bugs.php.net/bug.php?id=64153&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64153&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64153&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64153&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=64153&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=64153&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=64153&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=64153&r=needscript Try newer version: https://bugs.php.net/fix.php?id=64153&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=64153&r=support Expected behavior: https://bugs.php.net/fix.php?id=64153&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=64153&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=64153&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=64153&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64153&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=64153&r=dst IIS Stability: https://bugs.php.net/fix.php?id=64153&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=64153&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=64153&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=64153&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=64153&r=mysqlcfg