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); $serializedValuesChunk = array_slice(3, $chunks); var_dump($serializedValuesChunk); 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
Warning: array_slice() expects parameter 1 to be array, integer given in /in/e21i3 on line 11 NULL object(CantUnserializeThis)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } } Notice: unserialize(): Error at offset 26 of 31 bytes in /in/e21i3 on line 23 bool(false)
Output for 5.6.8 - 5.6.20, 7.0.0 - 7.0.5
Warning: array_slice() expects parameter 1 to be array, integer given in /in/e21i3 on line 11 NULL object(CantUnserializeThis)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } } string(19) "CantUnserializeThis"
Output for 5.6.21 - 5.6.28
Warning: array_slice() expects parameter 1 to be array, integer given in /in/e21i3 on line 11 NULL object(CantUnserializeThis)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } } Notice: unserialize(): Error at offset 26 of 31 bytes in /in/e21i3 on line 25 bool(false)
Output for 5.4.14 - 5.5.35
Warning: array_slice() expects parameter 1 to be array, integer given in /in/e21i3 on line 11 NULL Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Empty serialized string cannot be empty' in /in/e21i3:19 Stack trace: #0 [internal function]: ArrayObject->unserialize('') #1 /in/e21i3(19): unserialize('C:19:"CantUnser...') #2 {main} thrown in /in/e21i3 on line 19
Process exited with code 255.
Output for 5.4.0 - 5.4.13
Warning: array_slice() expects parameter 1 to be array, integer given in /in/e21i3 on line 11 NULL Notice: unserialize(): Error at offset 30 of 31 bytes in /in/e21i3 on line 19 Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Empty serialized string cannot be empty' in /in/e21i3:19 Stack trace: #0 [internal function]: ArrayObject->unserialize('') #1 /in/e21i3(19): unserialize('C:19:"CantUnser...') #2 {main} thrown in /in/e21i3 on line 19
Process exited with code 255.
Output for 5.3.3 - 5.3.29
Warning: array_slice() expects parameter 1 to be array, integer given in /in/e21i3 on line 11 NULL Notice: unserialize(): Error at offset 30 of 31 bytes in /in/e21i3 on line 19 Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Error at offset 0 of 0 bytes' in /in/e21i3:19 Stack trace: #0 /in/e21i3(19): unserialize('C:19:"CantUnser...') #1 {main} thrown in /in/e21i3 on line 19
Process exited with code 255.
Output for 5.3.0 - 5.3.2
Warning: array_slice() expects parameter 1 to be array, integer given in /in/e21i3 on line 11 NULL Notice: unserialize(): Error at offset 30 of 31 bytes in /in/e21i3 on line 0 Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Error at offset 0 of 0 bytes' in /in/e21i3:19 Stack trace: #0 /in/e21i3(19): unserialize('C:19:"CantUnser...') #1 {main} thrown in /in/e21i3 on line 19
Process exited with code 255.
Output for 5.2.6 - 5.2.17
Warning: array_slice() expects parameter 1 to be array, integer given in /in/e21i3 on line 11 NULL Warning: Class CantUnserializeThis has no unserializer in /in/e21i3 on line 19 Notice: unserialize(): Error at offset 25 of 31 bytes in /in/e21i3 on line 19 bool(false) string(19) "CantUnserializeThis"
Output for 5.2.1 - 5.2.5
Warning: array_slice(): The first argument should be an array in /in/e21i3 on line 11 NULL Warning: Class CantUnserializeThis has no unserializer in /in/e21i3 on line 19 Notice: unserialize(): Error at offset 25 of 31 bytes in /in/e21i3 on line 19 bool(false) string(19) "CantUnserializeThis"
Output for 5.1.0 - 5.2.0
Warning: array_slice(): The first argument should be an array in /in/e21i3 on line 11 NULL Warning: Class CantUnserializeThis has no unserializer in /in/e21i3 on line 19 Notice: unserialize(): Error at offset 25 of 31 bytes in /in/e21i3 on line 19 bool(false) Notice: unserialize(): Error at offset 0 of 31 bytes in /in/e21i3 on line 25 bool(false)
Output for 5.0.0 - 5.0.5
Warning: array_slice(): The first argument should be an array in /in/e21i3 on line 11 NULL Notice: unserialize(): Error at offset 0 of 31 bytes in /in/e21i3 on line 19 bool(false) Notice: unserialize(): Error at offset 0 of 31 bytes in /in/e21i3 on line 25 bool(false)
Output for 4.3.2 - 4.4.9
Fatal error: Class cantunserializethis: Cannot inherit from undefined class arrayobject in /in/e21i3 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/e21i3 on line 3