#25341 [NEW]: Parse error if using server variables as default function argument value

From: Date: Mon, 01 Sep 2003 11:57:02 +0000
Subject: #25341 [NEW]: Parse error if using server variables as default function argument value
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-46996@lists.php.net to get a copy of this message
From: martin at lucas-smith dot co dot uk Operating system: Win2K PHP version: 4.3.3 PHP Bug Type: Unknown/Other Function Bug description: Parse error if using server variables as default function argument value Description: ------------ Is there some reason why a $_GET or other server variable cannot be included directly within a function declaration, as its default value? If using the reproduce code below I get a parse error: Parse error: parse error, unexpected T_VARIABLE in [scriptaddress] on line [linenumber] Reproduce code: --------------- function queryParameters ($queryString = $_GET['QUERY_STRING']) { # Do something with $queryString } -- Edit bug report at http://bugs.php.net/?id=25341&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25341&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25341&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=25341&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=25341&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=25341&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=25341&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=25341&r=support Expected behavior: http://bugs.php.net/fix.php?id=25341&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=25341&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=25341&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=25341&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25341&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=25341&r=dst IIS Stability: http://bugs.php.net/fix.php?id=25341&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=25341&r=gnused

« previous php.bugs (#46996) next »