3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class SomeCollection extends ArrayObject {} $meh = unserialize('O:14:"SomeCollection":1:{i:0;s:4:"item";}'); var_dump('yay', $meh); var_dump($meh["0"]); $meh = unserialize('C:14:"SomeCollection":36:{x:i:0;a:1:{i:0;s:4:"item";};m:a:0:{}}'); var_dump('yay', $meh);
Output for 5.5.13, 5.6.0 - 7.1.0
Warning: Erroneous data format for unserializing 'SomeCollection' in /in/38gqp on line 6 Notice: unserialize(): Error at offset 25 of 41 bytes in /in/38gqp on line 6 string(3) "yay" bool(false) NULL string(3) "yay" object(SomeCollection)#1 (1) { ["storage":"ArrayObject":private]=> array(1) { [0]=> string(4) "item" } }
Output for 5.5.0 - 5.5.12, 5.5.14 - 5.5.35
string(3) "yay" object(SomeCollection)#1 (1) { ["storage":"ArrayObject":private]=> array(1) { ["0"]=> string(4) "item" } } Notice: Undefined offset: 0 in /in/38gqp on line 8 NULL string(3) "yay" object(SomeCollection)#2 (1) { ["storage":"ArrayObject":private]=> array(1) { [0]=> string(4) "item" } }
Output for 5.3.9 - 5.4.28, 5.4.30 - 5.4.45
string(3) "yay" object(SomeCollection)#1 (1) { ["storage":"ArrayObject":private]=> array(1) { ["0"]=> string(4) "item" } } NULL string(3) "yay" object(SomeCollection)#2 (1) { ["storage":"ArrayObject":private]=> array(1) { [0]=> string(4) "item" } }
Output for 5.4.29
Warning: Erroneous data format for unserializing 'SomeCollection' in /in/38gqp on line 6 string(3) "yay" bool(false) NULL string(3) "yay" object(SomeCollection)#1 (1) { ["storage":"ArrayObject":private]=> array(1) { [0]=> string(4) "item" } }
Output for 5.3.0 - 5.3.8
string(3) "yay" object(SomeCollection)#1 (1) { ["storage":"ArrayObject":private]=> array(1) { [0]=> string(4) "item" } } string(4) "item" string(3) "yay" object(SomeCollection)#2 (1) { ["storage":"ArrayObject":private]=> array(1) { [0]=> string(4) "item" } }
Output for 5.2.3 - 5.2.17
string(3) "yay" object(SomeCollection)#1 (1) { [0]=> string(4) "item" } string(4) "item" Warning: Class SomeCollection has no unserializer in /in/38gqp on line 9 string(3) "yay" bool(false)
Output for 5.1.0 - 5.2.2
string(3) "yay" object(SomeCollection)#1 (1) { [0]=> string(4) "item" } string(4) "item" <br /> <b>Warning</b>: Class SomeCollection has no unserializer in <b>/in/38gqp</b> on line <b>9</b><br /> string(3) "yay" bool(false)
Output for 5.0.0 - 5.0.5
string(3) "yay" object(SomeCollection)#1 (1) { [0]=> string(4) "item" } string(4) "item" string(3) "yay" bool(false)
Output for 4.3.2 - 4.4.9
<br /> <b>Fatal error</b>: Class somecollection: Cannot inherit from undefined class arrayobject in <b>/in/38gqp</b> on line <b>3</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Fatal error</b>: Class somecollection: Cannot inherit from undefined class arrayobject in <b>/in/38gqp</b> on line <b>3</b><br />