3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x=new GMP(0); $x=$x+1; var_dump($x); var_dump((int)$x); class a { public function __construct($a = null) { $this->a =& $a; } public function __destruct() { $this->a = null; } } $f= new SplFixedArray(5); $a=[$f]; $f[0]=new a($a); echo(serialize([$a])); //var_dump($f);
Output for 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6 - 8.3.7
object(GMP)#2 (1) { ["num"]=> string(1) "1" } int(1) Deprecated: Creation of dynamic property a::$a is deprecated in /in/7tALg on line 9 a:1:{i:0;a:1:{i:0;O:13:"SplFixedArray":5:{i:0;O:1:"a":1:{s:1:"a";N;}i:1;N;i:2;N;i:3;N;i:4;N;}}}
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 object(GMP)#2 (1) { ["num"]=> string(1) "1" } int(1) Deprecated: Creation of dynamic property a::$a is deprecated in /in/7tALg on line 9 a:1:{i:0;a:1:{i:0;O:13:"SplFixedArray":5:{i:0;O:1:"a":1:{s:1:"a";N;}i:1;N;i:2;N;i:3;N;i:4;N;}}}
Output for 7.3.0 - 7.3.31, 7.4.0 - 7.4.32, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28
object(GMP)#2 (1) { ["num"]=> string(1) "1" } int(1) a:1:{i:0;a:1:{i:0;O:13:"SplFixedArray":5:{i:0;O:1:"a":1:{s:1:"a";N;}i:1;N;i:2;N;i:3;N;i:4;N;}}}
Output for 8.0.13
Fatal error: Uncaught Error: Class "GMP" not found in /in/7tALg:2 Stack trace: #0 {main} thrown in /in/7tALg on line 2
Process exited with code 255.
Output for 7.3.32 - 7.3.33, 7.4.33
Fatal error: Uncaught Error: Class 'GMP' not found in /in/7tALg:2 Stack trace: #0 {main} thrown in /in/7tALg on line 2
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33
object(GMP)#2 (1) { ["num"]=> string(1) "1" } int(1) a:1:{i:0;a:1:{i:0;O:13:"SplFixedArray":5:{i:0;O:1:"a":1:{s:1:"a";a:1:{i:0;r:3;}}i:1;N;i:2;N;i:3;N;i:4;N;}}}

preferences:
163.81 ms | 402 KiB | 189 Q