Function parameter passed by reference with default value to null
| From: | Lupus Michaelis | Date: | Mon, 06 Jul 2009 09:28:37 +0000 |
| Subject: | Function parameter passed by reference with default value to null | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-294932@lists.php.net to get a copy of this message | ||
Hi,
I would like to know if I am alone to be shoked by this :
== 8< ==
function foo(& $bar = null)
{
}
foo() ; // runs
foo(null) ; // raise an error
== >8 ==
Why the default value to null for a reference is allowed ? Is it a bug, a feature ?
Thanks !
--
Mickaël Wolff aka Lupus Michaelis
http://lupusmic.org
Seeking for a position <http://lupusmic.org/pro/>