3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class CantUnserializeThis extends ArrayObject { } $className = 'CantUnserializeThis'; $serialized = serialize(new ArrayObject()); $chunks = explode(':', $serialized); $serializedValuesChunks = implode(':', array_slice($chunks, 3)); var_dump(unserialize(sprintf( 'C:%d:"%s":%s', strlen($className), $className, $serializedValuesChunks ))); var_dump(unserialize(sprintf( 'O:%d:"%s":%s', strlen($className), $className, $serializedValuesChunks )));
Output for 7.0.0 - 7.1.0
object(CantUnserializeThis)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } } Warning: Erroneous data format for unserializing 'CantUnserializeThis' in /in/Ss2Yk on line 22 Notice: unserialize(): Error at offset 31 of 53 bytes in /in/Ss2Yk on line 22 bool(false)
Output for hhvm-3.10.0 - 3.12.0
object(CantUnserializeThis)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } } Notice: Array to string conversion in /in/Ss2Yk on line 25 Notice: Unable to unserialize: [O:19:"CantUnserializeThis":84:{a:3:{s:7:"storage";a:0:{}s:5:"flags";i:0;s:13:"iteratorClass";s:13:"ArrayIterator";}}]. Unexpected end of buffer during unserialization. in /in/Ss2Yk on line 25 bool(false)
Output for 5.4.29, 5.6.8 - 5.6.28
object(CantUnserializeThis)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } } Warning: Erroneous data format for unserializing 'CantUnserializeThis' in /in/Ss2Yk on line 25 Notice: unserialize(): Error at offset 31 of 53 bytes in /in/Ss2Yk on line 25 bool(false)
Output for 5.3.0 - 5.4.28, 5.4.30 - 5.5.35
object(CantUnserializeThis)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } } Notice: unserialize(): Error at offset 31 of 53 bytes in /in/Ss2Yk on line 25 bool(false)
Output for 5.1.0 - 5.2.17
Warning: Class CantUnserializeThis has no unserializer in /in/Ss2Yk on line 18 Notice: unserialize(): Error at offset 25 of 31 bytes in /in/Ss2Yk on line 18 bool(false) object(CantUnserializeThis)#1 (0) { }
Output for 5.0.0 - 5.0.5
Notice: unserialize(): Error at offset 0 of 31 bytes in /in/Ss2Yk on line 18 bool(false) object(CantUnserializeThis)#1 (0) { }
Output for 4.3.2 - 4.4.9
Fatal error: Class cantunserializethis: Cannot inherit from undefined class arrayobject in /in/Ss2Yk on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Class cantunserializethis: Cannot inherit from undefined class arrayobject in /in/Ss2Yk on line 3