Function parameter passed by reference with default value to null

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  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/>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux