ID: 32585 Updated by: [EMAIL PROTECTED] Reported By: c dot i dot morris at durham dot ac dot uk -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 4.3.10 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php That's the way it works... Previous Comments: ------------------------------------------------------------------------ [2005-04-05 11:47:20] c dot i dot morris at durham dot ac dot uk Description: ------------ When constructing a variable name using the $$foo syntax, it is only possible to reference a superglobal in this way from outside a function. Inside a function it appears to reference a variable with the same name that is local to the function. In other words, the code $foo='_REQUEST'; print (${$foo}['bar']); behaves differently within a function and within the main loop. I've been able to reproduce this bug on several servers with different configurations. 4.3.10 is the latest version I have available to test. Reproduce code: --------------- Demonstration http://www.dur.ac.uk/c.i.morris/superglobals.php?foo=123 Source code http://www.dur.ac.uk/c.i.morris/superglobals.phps [Note: this server is running an older version of PHP, but the same effect happens on a non-public server running 4.3.10] Expected result: ---------------- Out of the function:123 In the function:123 Actual result: -------------- Out of the function:123 In the function: ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32585&edit=1
