#6566 [Com]: Function default argmnt. doesn't accept variable
| From: | misc at instantmassacre dot com | Date: | Fri, 10 Jan 2003 17:22:11 +0000 |
| Subject: | #6566 [Com]: Function default argmnt. doesn't accept variable | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-29693@lists.php.net to get a copy of this message | ||
ID: 6566
Comment by: misc@instantmassacre.com
Reported By: amri@easternaura.com
Status: Closed
Bug Type: Variables related
Operating System: Redhat Linux 6.2
PHP Version: 4.0.2
New Comment:
Still apparant in PHP 4.2.3 and 4.3.0
As stated this behaviour is documented and will not change. Why is
this?
Would Incompatibility with PHP3, being it only the minority of PHP
servers are still running PHP3, be the issue?
Previous Comments:
------------------------------------------------------------------------
[2000-09-05 23:51:21] sterling@php.net
Forgot to close.
------------------------------------------------------------------------
[2000-09-05 23:50:25] sterling@php.net
Documented incompatibility between PHP3 & PHP4, probably will not
change.
------------------------------------------------------------------------
[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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=6566&edit=1