default values in function call behaves differently in PHP5.2.4 and PHP5.0.4

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

 



Hi list.
I am quite new in the area.

I found a difference between PHP 5.2.4 to 5.0.4 in case of passing
parameter to function, with default value:

f1(&$par=0);

in 5.2.4 the par is assigned to zero AFTER function call
and thus, par is always ZERO !

The desired code in 5.2.4 should probably be:
$par=0;
f1(&$par);

in 5.0.4 in is INITIALIZED to zero, BEFORE function call!
and the return value is according to f1.

Am I right?
Is it a bug?
Is it documented?

Thanks
Dor

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