* Thus wrote Robert Cummings:
> 
> As exemplified in the sample script I sent in my last response and by
> the link sent by Hannes Magnusson, in PHP5 the following have identical
> behaviour:
> 
>     $o1 = new Foo();
>     $o2 = $o1;
> 
>     // Is same as...
> 
>     $o1 = new Foo();
>     $o2 =& $o1;

But = and =& are not identical:

<?php
class foo { };

$a = new foo();
$b = $a;

var_dump($b); /* object #1 */
$a = null;
var_dump($b); /* object #1 */

$c = new foo();
$d = &$c;

var_dump($d); /* object #2 */
$c = null;
var_dump($d); /* NULL */

?>


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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

Reply via email to