--TEST-- unpack of template converter: class unpacker (array: object: OPT_PHPONLY=false) --SKIPIF-- setOption(MessagePack::OPT_PHPONLY, false); $serialized = $msgpack->pack($variable); $unserialized = $msgpack->unpack($serialized, $object); var_dump($unserialized); if ($result) { echo $unserialized == $result ? 'OK' : 'ERROR', PHP_EOL; } else { echo 'SKIP', PHP_EOL; } } class MyObj { private $data = null; private $priv = "privdata"; public $pdata = null; function __construct() { $this->data = "datadata"; } } $obj = new MyObj(); $obj->pdata = "pubdata0"; $obj2 = new MyObj(); $obj2->pdata = "pubdata1"; $ary = array($obj, $obj2); $tpl = array(new MyObj()); test("object list /w instance", $ary, $tpl, $ary); --EXPECTF-- array(2) { [0]=> object(MyObj)#%d (3) { [%r"?data"?:("MyObj":)?private"?%r]=> string(8) "datadata" [%r"?priv"?:("MyObj":)?private"?%r]=> string(8) "privdata" ["pdata"]=> string(8) "pubdata0" } [1]=> object(MyObj)#%d (3) { [%r"?data"?:("MyObj":)?private"?%r]=> string(8) "datadata" [%r"?priv"?:("MyObj":)?private"?%r]=> string(8) "privdata" ["pdata"]=> string(8) "pubdata1" } } OK