RE: Tidying code for PHP5.0.5/PHP4.4.0

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

 



Rasmus Lerdorf wrote:
> Michael Sims wrote:
>> When used as an expression, an assignment evaluates to whatever is
>> on the right side of the assignment operator, not the left. 
>> Example:  
[...]
>> foo($a = 5);
>> and
>> foo(5);
>> 
>> are exactly the same...
> 
> The value passed is the same, but when passed as $a=5 then the value
> has a symbol table entry associated with it whereas if you just pass
> in 5 it doesn't.  That means that:
> 
> function foo(&$arg) { $arg =6; }
> 
> will work if you call: foo($a=5);
> but you will get an error if you have: foo(5);

Oops, sorry for posting misinformation, I was not aware of the above...  Thanks for the info.

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