Bug #18452 Updated: Superglobals appear to not work...

From: Date: Mon, 22 Jul 2002 23:54:19 +0000
Subject: Bug #18452 Updated: Superglobals appear to not work...
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-14813@lists.php.net to get a copy of this message
ID: 18452 Updated by: dilbert@hack3r.com Reported By: dilbert@hack3r.com Status: Bogus Bug Type: Variables related Operating System: OpenBSD PHP Version: 4.2.1 New Comment: you just told me I was crazy ;) but okay, I fixed that problem (heh) this STILL isn't a bogus bug, however... Look at the example page i supplied above, .... echo "<br><hr>"; $h = "_GET"; print_r($$h); // Works! echo "<br><hr>"; function pr2() { $g = "_GET"; print_r($$g); } // DOESN'T WORK! pr2(); .... That part is still true. Comments and all. Now, thats the bug I was dealing with previously (before i screwed up and figured all superglobals didn't work :/) I knew I messed something up, at least I've finally got this refined... Am I missing something again, or have I finally nailed it? Ted Previous Comments: ------------------------------------------------------------------------ [2002-07-21 14:21:57] tal@php.net Of course it doesn't work, you don't call the functions... -Tal ------------------------------------------------------------------------ [2002-07-20 22:42:44] dilbert@hack3r.com An example of this failure can be seen here: http://roothack.org/~articles/test.php?var=value (wonder how many tries this is going to take...) ------------------------------------------------------------------------ [2002-07-20 22:41:40] dilbert@hack3r.com An example of this failure can be seen here: http://roothack.org/articles/test.php?var=value (case...) ------------------------------------------------------------------------ [2002-07-20 22:39:02] dilbert@hack3r.com An example of this failure can be seen here: http://roothack.org/Articles/test.php?var=value The Source to that page is here: <? // PHP 4.2.1 // get like: file.php?name=hi // Isn't $_GET supposed to be "superglobal" ? print_r($_GET); // Works! echo "<br><hr>"; function pr1() { print_r($_GET); } // DOESN'T WORK! echo "<br><hr>"; $h = "_GET"; print_r($$h); // Works! echo "<br><hr>"; function pr2() { $g = "_GET"; print_r($$g); } // DOESN'T WORK! echo "<br><hr>"; function pr3() { global $_GET; print_r($_GET); } // DOESN'T WORK!?? ?> Information about the server can be found here: http://roothack.org/~articles/test2.php (its phpinfo();) Please tell me I'm not crazy... ;) Ted Kaminski ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18452&edit=1

« previous php.bugs (#14813) next »