PHP 4.0 Bug #6566 Updated: Function default argmnt. doesn't accept variable
| From: | Bug Database | Date: | Wed, 06 Sep 2000 03:50:26 +0000 |
| Subject: | PHP 4.0 Bug #6566 Updated: Function default argmnt. doesn't accept variable | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-32294@lists.php.net to get a copy of this message | ||
ID: 6566
Updated by: sterling
Reported By: amri@easternaura.com
Status: Open
Bug Type: Variables related
Assigned To:
Comments:
Documented incompatibility between PHP3 & PHP4, probably will not change.
Previous Comments:
[2000-09-05 23:31:13] amri@easternaura.com
Default function argument doesn't accept variable.
function echoname ($name = 'bob')
works fine but
$bob = 'bob';
function echoname ($name = $bob)
will produce error.
I'm not sure either this is a bug or limitation but I guess its useful if variable is
allowed as default function argument.
regards,
amri
---------------------------------------------------------------------------
[2000-09-05 23:28:42] amri@easternaura.com
Default function argument doesn't accept variable.
function echoname ($name = 'bob')
works fine but
$him = 'bob';
function echoname ($name = $bob)
will produce error.
I'm not sure either this is a bug or limitation but I guess its useful if variable is allowed
as default function argument.
regards,
amri
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=6566