#25341 [Opn->Bgs]: Parse error if using server variables as default function argument value

From: Date: Mon, 01 Sep 2003 11:58:10 +0000
Subject: #25341 [Opn->Bgs]: Parse error if using server variables as default function argument value
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-46997@lists.php.net to get a copy of this message
ID: 25341 Updated by: derick@php.net Reported By: martin at lucas-smith dot co dot uk -Status: Open +Status: Bogus Bug Type: Unknown/Other Function Operating System: Win2K PHP Version: 4.3.3 New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Thank you for your interest in PHP. It has nothing to do with it being a superglobal or not. You just can ONLY use constants as default values. Derick Previous Comments: ------------------------------------------------------------------------ [2003-09-01 06:57:02] martin at lucas-smith dot co dot uk 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 this bug report at http://bugs.php.net/?id=25341&edit=1

« previous php.bugs (#46997) next »