#39808 [Opn->Bgs]: null does not set default in function
| From: | tony2001@php.net | Date: | Tue, 12 Dec 2006 21:00:49 +0000 |
| Subject: | #39808 [Opn->Bgs]: null does not set default in function | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-106271@lists.php.net to get a copy of this message | ||
ID: 39808
Updated by: tony2001@php.net
Reported By: david at 1st-affiliation dot com
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: fedora core 4
PHP Version: 5.2.0
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Previous Comments:
------------------------------------------------------------------------
[2006-12-12 20:52:21] david at 1st-affiliation dot com
Description:
------------
Hi
Since I upgrade the php version, the comportement of the function
default argument as change.
Previously, when I set a parameter to "null" the function use the
default value of the parameter.
Now it kept the null value, and I do not find a another way to set the
default value.
See the code for more information
Reproduce code:
---------------
<?php
function eat ($what='apple') {
print 'I eat '.$what;
}
eat(null);
?>
Expected result:
----------------
I eat apple
Actual result:
--------------
I eat
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39808&edit=1