3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x=new GMP(0); $x=$x+1; var_dump($x); var_dump((int)$x); class a { public $a; public function __destruct() { $this->a = null; } } $f= new SplFixedArray(5); $a=[$f]; $f[0]=new a(); $f[0]->a =& $a; echo(serialize([$a])); //var_dump($f);
based on 7tALg
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.2.6, 7.3.0rc3
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;}}}
Output for 7.3.0alpha1 - 7.3.0beta1
Fatal error: Uncaught Error: Class 'GMP' not found in /in/C6LuN:2 Stack trace: #0 {main} thrown in /in/C6LuN on line 2
Process exited with code 255.
Output for hhvm-3.18.4 - 3.21.0
Notice: Object of class GMP could not be converted to int in /in/C6LuN on line 3 int(2) int(2) a:1:{i:0;a:1:{i:0;O:13:"SplFixedArray":1:{s:7:"*data";a: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;}}}}