From: valentiny510 at yahoo dot es Operating system: XP PHP version: 5.4.7 Package: Variables related Bug Type: Feature/Change Request Bug description:Allow custom GLOBAL variables
Description: ------------ I think can be very usefull, sometimes, to be able to make a custom global variable, like languages, configs, etc.. and working just like $GLOBALS but only with the value/values assigned. I'm sure more than 75%-80% of the Php users will be agreed with this change. Imagine and array with some translation strings: $lang = array( 'bla' => 'some nonsense talk', 'blabla' => 'More nonsense talks'); and now the 'trick'.. some function to make 'global' the $lang: make_global( $lang ); or even set in the php.ini some configuration like: custom_globals = "lang, config, more, etc, bla, bla" and now we can use it on global scope function test() { return $lang['bla']; } is a 'nicer' way than function test() { return $GLOBALS['lang']['bla']; } or function test() { global $lang; return $lang['bla']; } Test script: --------------- -- none -- Expected result: ---------------- -- none -- Actual result: -------------- -- none -- -- Edit bug report at https://bugs.php.net/bug.php?id=63137&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63137&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63137&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63137&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=63137&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=63137&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=63137&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=63137&r=needscript Try newer version: https://bugs.php.net/fix.php?id=63137&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=63137&r=support Expected behavior: https://bugs.php.net/fix.php?id=63137&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=63137&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=63137&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=63137&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63137&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=63137&r=dst IIS Stability: https://bugs.php.net/fix.php?id=63137&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=63137&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=63137&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=63137&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=63137&r=mysqlcfg