dev dot php at linke-t dot net (30-Aug-2010 05:01)
I thought Yeah pointer likly behavior... but i watched serilized objects and what i did see? referenced Objects are outputed like the object self.
Here is a simple code, it shows that the references are sweet but in some case (storing objects to $_SESSION or Database) unuseable:
<?php class foo{
private static $id_c = 0;
public $ref;
public $id;
public function foo(){ $this->id=self::$id_c++;
}
} $a = new foo(); $b = new foo(); $a->ref = &$b;