3v4l.org

run code in 300+ PHP versions simultaneously
<?php class CantUnserializeThis extends ArrayObject { } $className = 'CantUnserializeThis'; var_dump(unserialize(sprintf( 'C:%d:"%s":0:{}', strlen($className), $className ))); var_dump(unserialize(sprintf( 'S:%d:"%s":0:{}', strlen($className), $className )));
Output for 8.3.0 - 8.3.6
object(CantUnserializeThis)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } } Warning: unserialize(): Error at offset 26 of 31 bytes in /in/YGgfO on line 15 bool(false)
Output for 8.2.0 - 8.2.18
object(CantUnserializeThis)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } } Notice: unserialize(): Error at offset 26 of 31 bytes in /in/YGgfO on line 15 bool(false)
Output for 7.0.19 - 7.0.33, 7.1.5 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28
object(CantUnserializeThis)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } } Notice: unserialize(): Error at offset 26 of 31 bytes in /in/YGgfO on line 18 bool(false)
Output for 7.3.32 - 7.3.33
object(CantUnserializeThis)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } } bool(false)
Output for 7.0.6 - 7.0.18, 7.1.0 - 7.1.4
object(CantUnserializeThis)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } } Notice: unserialize(): Error at offset 26 of 31 bytes in /in/YGgfO on line 17 bool(false)
Output for 5.6.0 - 5.6.20, 7.0.0 - 7.0.5
object(CantUnserializeThis)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } } string(19) "CantUnserializeThis"
Output for 5.6.21 - 5.6.40
object(CantUnserializeThis)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } } Notice: unserialize(): Error at offset 26 of 31 bytes in /in/YGgfO on line 19 bool(false)
Output for 5.4.14 - 5.4.45, 5.5.0 - 5.5.38
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Empty serialized string cannot be empty' in /in/YGgfO:13 Stack trace: #0 [internal function]: ArrayObject->unserialize('') #1 /in/YGgfO(13): unserialize('C:19:"CantUnser...') #2 {main} thrown in /in/YGgfO on line 13
Process exited with code 255.
Output for 5.4.0 - 5.4.13
Notice: unserialize(): Error at offset 30 of 31 bytes in /in/YGgfO on line 13 Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Empty serialized string cannot be empty' in /in/YGgfO:13 Stack trace: #0 [internal function]: ArrayObject->unserialize('') #1 /in/YGgfO(13): unserialize('C:19:"CantUnser...') #2 {main} thrown in /in/YGgfO on line 13
Process exited with code 255.
Output for 5.3.3 - 5.3.29
Notice: unserialize(): Error at offset 30 of 31 bytes in /in/YGgfO on line 13 Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Error at offset 0 of 0 bytes' in /in/YGgfO:13 Stack trace: #0 /in/YGgfO(13): unserialize('C:19:"CantUnser...') #1 {main} thrown in /in/YGgfO on line 13
Process exited with code 255.
Output for 5.3.0 - 5.3.2
Notice: unserialize(): Error at offset 30 of 31 bytes in /in/YGgfO on line 0 Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Error at offset 0 of 0 bytes' in /in/YGgfO:13 Stack trace: #0 /in/YGgfO(13): unserialize('C:19:"CantUnser...') #1 {main} thrown in /in/YGgfO on line 13
Process exited with code 255.
Output for 5.2.1 - 5.2.17
Warning: Class CantUnserializeThis has no unserializer in /in/YGgfO on line 13 Notice: unserialize(): Error at offset 25 of 31 bytes in /in/YGgfO on line 13 bool(false) string(19) "CantUnserializeThis"
Output for 5.1.0 - 5.1.6, 5.2.0
Warning: Class CantUnserializeThis has no unserializer in /in/YGgfO on line 13 Notice: unserialize(): Error at offset 25 of 31 bytes in /in/YGgfO on line 13 bool(false) Notice: unserialize(): Error at offset 0 of 31 bytes in /in/YGgfO on line 19 bool(false)
Output for 5.0.0 - 5.0.5
Notice: unserialize(): Error at offset 0 of 31 bytes in /in/YGgfO on line 13 bool(false) Notice: unserialize(): Error at offset 0 of 31 bytes in /in/YGgfO on line 19 bool(false)
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Fatal error: Class cantunserializethis: Cannot inherit from undefined class arrayobject in /in/YGgfO 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/YGgfO on line 3

preferences:
341.25 ms | 401 KiB | 460 Q