3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = new SplFixedArray(5); $array[0] = 'boo'; $array[1] = 'baz'; var_dump($array); var_dump(json_encode($array));
based on tdosL
Output for 5.3.0 - 7.1.0
object(SplFixedArray)#1 (5) { [0]=> string(3) "boo" [1]=> string(3) "baz" [2]=> NULL [3]=> NULL [4]=> NULL } string(48) "{"0":"boo","1":"baz","2":null,"3":null,"4":null}"
Output for 5.0.0 - 5.2.17
Fatal error: Class 'SplFixedArray' not found in /in/VgOep on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: splfixedarray in /in/VgOep on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: splfixedarray in /in/VgOep on line 2