superglobals inside of function declarations

From: Date: Thu, 30 Oct 2003 10:26:33 +0000
Subject: superglobals inside of function declarations
Groups: php.internals 
Request: Send a blank email to internals+get-5101@lists.php.net to get a copy of this message
Hello, I've been using PHP for quite a while now and i'm getting interested it's internal beheaviour. I'm wondering why it isn't possible to use a global variable inside of a function declaration. For example: <? function refresh($location = $_SERVER['PHP_SELF']) { //refresh and load $location } //refreshes the page refresh(); //redirects to another page refresh("http://www.php.net/"); ?> Of course there are ways to circumvent this problem that have the same result, but require more code. IMHO allowing globals inside of function declarions will create interesting possibilities that could result in more efficient code. Regards, Filip de Waard Net Collective www.netcollective.nl

« previous php.internals (#5101) next »