From: sverel at mail dot ru
Operating system: Windows XP build 2600 (SP2)
PHP version: 4.3.8
PHP Bug Type: Scripting Engine problem
Bug description: Not work constraction of "variable of variable"
Description:
------------
------
Reproduce code:
---------------
Not working:
<?php
$G= 'GLOBALS';
print "${$G}".'<HR>';
/* printing "Notice: Undefined variable: GLOBALS in C:\http\globals.php on
line 22" */
print "${$G}<HR>";
/* printing "Notice: Undefined variable: GLOBALS in C:\http\globals.php on
line 23" */
// print $GLOBALS.'<HR>';
?>
Working:
<?php
$G= 'GLOBALS';
print "${$G}".'<HR>'; // printing "Array"
print "${$G}<HR>"; // printing "Array"
print $GLOBALS.'<HR>';
?>
Expected result:
----------------
Notice: Undefined variable: GLOBALS in C:\http\globals.php on line 23
Actual result:
--------------
Array
--
Edit bug report at http://bugs.php.net/?id=31260&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31260&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=31260&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=31260&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=31260&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=31260&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=31260&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=31260&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=31260&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=31260&r=support
Expected behavior: http://bugs.php.net/fix.php?id=31260&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=31260&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=31260&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=31260&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31260&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=31260&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=31260&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=31260&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=31260&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=31260&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=31260&r=mysqlcfg