--TEST-- unpack of template converter (object) --SKIPIF-- data = "datadata"; $this->subary = new SubObj(); } } class SubObj { private $subdata = null; private $subpriv = "subprivdata"; public $subpdata = null; function __construct() { $this->subdata = "subdatadata"; } } $obj = new MyObj(); $obj->pdata = "pubdata"; $obj->subary->subpdata = "subpubdata"; $tpl = new MyObj(); test("recursive object /w instance", $obj, $tpl, $obj); --EXPECTF-- object(MyObj)#%d (4) { [%r"?data"?:("MyObj":)?private"?%r]=> string(8) "datadata" [%r"?priv"?:("MyObj":)?private"?%r]=> string(8) "privdata" ["pdata"]=> string(7) "pubdata" ["subary"]=> object(SubObj)#%d (3) { [%r"?subdata"?:("SubObj":)?private"?%r]=> string(11) "subdatadata" [%r"?subpriv"?:("SubObj":)?private"?%r]=> string(11) "subprivdata" ["subpdata"]=> string(10) "subpubdata" } } OK