|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-12-23 01:19 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sun Aug 30 03:00:02 2026 UTC |
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