3v4l.org

run code in 200+ 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.20, 7.1.5 - 7.2.6
object(CantUnserializeThis)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } } Warning: Erroneous data format for unserializing 'CantUnserializeThis' in /in/Ss2Yk on line 24 Notice: unserialize(): Error at offset 31 of 53 bytes in /in/Ss2Yk on line 24 bool(false)
Output for 7.0.0 - 7.0.14, 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 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