3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class CantUnserializeThis extends ArrayObject { } $className = 'CantUnserializeThis'; var_dump(serialize(new ArrayObject())); var_dump(unserialize(sprintf( 'C:%d:"%s":0:{}', strlen($className), $className ))); var_dump(unserialize(sprintf( 'S:%d:"%s":0:{}', strlen($className), $className )));
Output for 7.0.6 - 7.1.0
string(45) "C:11:"ArrayObject":21:{x:i:0;a:0:{};m:a:0:{}}" object(CantUnserializeThis)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } } Notice: unserialize(): Error at offset 26 of 31 bytes in /in/UJJhN on line 18 bool(false)
Output for 5.6.8 - 5.6.20, 7.0.0 - 7.0.5
string(45) "C:11:"ArrayObject":21:{x:i:0;a:0:{};m:a:0:{}}" object(CantUnserializeThis)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } } string(19) "CantUnserializeThis"
Output for hhvm-3.10.0 - 3.12.0
string(108) "C:11:"ArrayObject":84:{a:3:{s:7:"storage";a:0:{}s:5:"flags";i:0;s:13:"iteratorClass";s:13:"ArrayIterator";}}" Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Empty serialized string cannot be empty' in /in/UJJhN:14 Stack trace: #0 /in/UJJhN(14): ArrayObject->unserialize() #1 {main}
Process exited with code 255.
Output for 5.6.21 - 5.6.28
string(45) "C:11:"ArrayObject":21:{x:i:0;a:0:{};m:a:0:{}}" object(CantUnserializeThis)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } } Notice: unserialize(): Error at offset 26 of 31 bytes in /in/UJJhN on line 20 bool(false)
Output for 5.4.14 - 5.5.35
string(45) "C:11:"ArrayObject":21:{x:i:0;a:0:{};m:a:0:{}}" Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Empty serialized string cannot be empty' in /in/UJJhN:14 Stack trace: #0 [internal function]: ArrayObject->unserialize('') #1 /in/UJJhN(14): unserialize('C:19:"CantUnser...') #2 {main} thrown in /in/UJJhN on line 14
Process exited with code 255.
Output for 5.4.0 - 5.4.13
string(45) "C:11:"ArrayObject":21:{x:i:0;a:0:{};m:a:0:{}}" Notice: unserialize(): Error at offset 30 of 31 bytes in /in/UJJhN on line 14 Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Empty serialized string cannot be empty' in /in/UJJhN:14 Stack trace: #0 [internal function]: ArrayObject->unserialize('') #1 /in/UJJhN(14): unserialize('C:19:"CantUnser...') #2 {main} thrown in /in/UJJhN on line 14
Process exited with code 255.
Output for 5.3.3 - 5.3.29
string(45) "C:11:"ArrayObject":21:{x:i:0;a:0:{};m:a:0:{}}" Notice: unserialize(): Error at offset 30 of 31 bytes in /in/UJJhN on line 14 Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Error at offset 0 of 0 bytes' in /in/UJJhN:14 Stack trace: #0 /in/UJJhN(14): unserialize('C:19:"CantUnser...') #1 {main} thrown in /in/UJJhN on line 14
Process exited with code 255.
Output for 5.3.0 - 5.3.2
string(45) "C:11:"ArrayObject":21:{x:i:0;a:0:{};m:a:0:{}}" Notice: unserialize(): Error at offset 30 of 31 bytes in /in/UJJhN on line 0 Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Error at offset 0 of 0 bytes' in /in/UJJhN:14 Stack trace: #0 /in/UJJhN(14): unserialize('C:19:"CantUnser...') #1 {main} thrown in /in/UJJhN on line 14
Process exited with code 255.
Output for 5.2.1 - 5.2.17
string(23) "O:11:"ArrayObject":0:{}" Warning: Class CantUnserializeThis has no unserializer in /in/UJJhN on line 14 Notice: unserialize(): Error at offset 25 of 31 bytes in /in/UJJhN on line 14 bool(false) string(19) "CantUnserializeThis"
Output for 5.1.0 - 5.2.0
string(23) "O:11:"ArrayObject":0:{}" Warning: Class CantUnserializeThis has no unserializer in /in/UJJhN on line 14 Notice: unserialize(): Error at offset 25 of 31 bytes in /in/UJJhN on line 14 bool(false) Notice: unserialize(): Error at offset 0 of 31 bytes in /in/UJJhN on line 20 bool(false)
Output for 5.0.0 - 5.0.5
string(23) "O:11:"ArrayObject":0:{}" Notice: unserialize(): Error at offset 0 of 31 bytes in /in/UJJhN on line 14 bool(false) Notice: unserialize(): Error at offset 0 of 31 bytes in /in/UJJhN on line 20 bool(false)
Output for 4.3.2 - 4.4.9
Fatal error: Class cantunserializethis: Cannot inherit from undefined class arrayobject in /in/UJJhN 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/UJJhN on line 3