Bug #13353 Updated: function calling causes error with varable
| From: | rasmus@php.net | Date: | Mon, 17 Sep 2001 20:30:58 +0000 |
| Subject: | Bug #13353 Updated: function calling causes error with varable | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-66139@lists.php.net to get a copy of this message | ||
ID: 13353
Updated by: rasmus
Reported By: knightemu@yahoo.com
Old Status: Open
Status: Closed
Bug Type: Variables related
Operating System: win 98 box
PHP Version: 4.0.4pl1
New Comment:
Variable default values are not supported. A workaround would be to assign it a bogus value and
check for that in your function.
eg.
function foo($arg=NULL) {
if($arg==NULL) $arg = $GLOBALS['str'];
}
Previous Comments:
------------------------------------------------------------------------
[2001-09-17 16:26:15] knightemu@yahoo.com
I am not sure if this is a bug or php is just not built to handle something like this, but when i
call a function like this:
function
EchoContent($BarName="Error",$body="error.inc",$topheight="100",$width=$menuwidth){
it causes an error! you cant assign a variable within the function call.
i would have to re-do it like this for it not to cause an error.
function
EchoContent($BarName="Error",$body="error.inc",$topheight="100",$width="100"){
I am sure you can see the benefits of using the top version.
Knight
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=13353&edit=1