<?php class A implements Serializable { function __construct($o) { $this->o =& $o; } function serialize() { return serialize([&$this->o]); } function unserialize($s) { $this->o =& unserialize($s)[0]; } } $o = [new stdClass]; $r = unserialize(serialize([new A($o), new A($o)])); var_dump($r[0]->o[0] === $r[1]->o[0]);
You have javascript disabled. You will not be able to edit any code.