3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = new SplFixedArray(2); $x[1] = "a"; $x->{"1"} = "b"; $x->{"123"} = "c"; var_dump($x); var_dump(serialize($x)); var_dump(unserialize(serialize($x)));
Output for 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.5.0 - 8.5.1
Deprecated: Creation of dynamic property SplFixedArray::$1 is deprecated in /in/uZH8a on line 6 Deprecated: Creation of dynamic property SplFixedArray::$123 is deprecated in /in/uZH8a on line 7 object(SplFixedArray)#1 (4) { [0]=> NULL [1]=> string(1) "a" ["1"]=> string(1) "b" ["123"]=> string(1) "c" } string(77) "O:13:"SplFixedArray":4:{i:0;N;i:1;s:1:"a";s:1:"1";s:1:"b";s:3:"123";s:1:"c";}" object(SplFixedArray)#2 (3) { [0]=> NULL [1]=> string(1) "b" [2]=> string(1) "c" }
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 8.2.5 - 8.2.29
Deprecated: Creation of dynamic property SplFixedArray::$1 is deprecated in /in/uZH8a on line 6 Deprecated: Creation of dynamic property SplFixedArray::$123 is deprecated in /in/uZH8a on line 7 object(SplFixedArray)#1 (4) { ["1"]=> string(1) "b" ["123"]=> string(1) "c" [0]=> NULL [1]=> string(1) "a" } string(77) "O:13:"SplFixedArray":4:{i:0;N;i:1;s:1:"a";s:1:"1";s:1:"b";s:3:"123";s:1:"c";}" object(SplFixedArray)#2 (3) { [0]=> NULL [1]=> string(1) "b" [2]=> string(1) "c" }
Output for 8.2.0 - 8.2.4
Deprecated: Creation of dynamic property SplFixedArray::$1 is deprecated in /in/uZH8a on line 6 Deprecated: Creation of dynamic property SplFixedArray::$123 is deprecated in /in/uZH8a on line 7 object(SplFixedArray)#1 (4) { ["1"]=> string(1) "b" ["123"]=> string(1) "c" [0]=> NULL [1]=> string(1) "a" }
Process exited with code 139.
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.33
object(SplFixedArray)#1 (4) { ["1"]=> string(1) "b" ["123"]=> string(1) "c" [0]=> NULL [1]=> string(1) "a" } string(77) "O:13:"SplFixedArray":4:{s:1:"1";s:1:"b";s:3:"123";s:1:"c";i:0;N;i:1;s:1:"a";}" object(SplFixedArray)#2 (3) { [0]=> string(1) "a" [1]=> string(1) "c" [2]=> NULL }

preferences:
92.15 ms | 413 KiB | 5 Q