ID: 28237 Updated by: [EMAIL PROTECTED] Reported By: marcel at vernix dot org -Status: Open +Status: Bogus Bug Type: Class/Object related Operating System: Debian GNU/Linux 2.4.20 PHP Version: 4.3.4 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 . Previous Comments: ------------------------------------------------------------------------ [2004-04-30 18:57:21] marcel at vernix dot org Description: ------------ When the name of a built in array is stored inside of an object attribute, its contents can't be access from the 'variable variable' without the use of eval. So, print_r(${$this->array}) and print_r($$this->array) don't work, but eval("print_r(\${$this->array});") does. When trying the same thing on a "regular" variable variable, it works as expected. Reproduce code: --------------- <?php $built_in_array = '_SERVER'; class klass { function klass($array = '_SERVER') { $this->array = $array; } function printit() { print_r(${$this->array}); #eval ("print_r(\${$this->array});"); } } print_r(${$built_in_array}); $k = new klass(); $k->printit(); ?> Expected result: ---------------- Array ( [HZ] => 100 [TERM] => rxvt [SHELL] => /bin/bash [WINDOWID] => 31457282 ...etc... Array ( [HZ] => 100 [TERM] => rxvt [SHELL] => /bin/bash [WINDOWID] => 31457282 ...etc... Actual result: -------------- Array ( [HZ] => 100 [TERM] => rxvt [SHELL] => /bin/bash [WINDOWID] => 31457282 ...etc... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28237&edit=1
