|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-09-17 16:26 UTC] knightemu at yahoo dot 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 08:00:02 2025 UTC |
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']; }