| 
	
 | 
 Posted by gosha bine on 09/27/07 15:43 
Summercool wrote: 
> seems like in PHP 5, $obj1 = $obj2  is not the same as $obj1 =& $obj2 
>  
> although the manual says... 
>  
> http://www.php.net/manual/en/language.operators.assignment.php 
>  
>> Since PHP 4, assignment by reference has been supported, 
>> using the $var = &$othervar 
>  
>> As of PHP 5, objects are assigned by reference 
>> unless explicitly told otherwise with the new clone 
>> keyword. 
>  
 
The manual is incorrect at this point. Object variables in php5 are  
assigned by value, just like in php4, but this very value is different  
in php5 - it's a pointer to the object, not the object itself. But this  
is essentially another story and has nothing to do with references. 
 
 
--  
gosha bine 
 
extended php parser ~ http://code.google.com/p/pihipi 
blok ~ http://www.tagarga.com/blok
 
  
Navigation:
[Reply to this message] 
 |