--TEST-- Closure --SKIPIF-- serialize()]; } public function __unserialize($serialized) { return $this->unserialize($serialized[0]); } } $array = array($closure, new Foo()); try { $ser = msgpack_serialize($array); echo "Serialized closure.\n"; $unser = msgpack_unserialize($ser); echo "Unserialized closure.\n"; var_dump($unser); } catch (Exception $e) { echo "Got exception.\n"; } --EXPECT-- Got exception.