3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { public $a; public $b; } $foos = []; for ($i = 10000; $i--;) { $foo = new Foo; $foo->a = 1; $foo->b = 2; $foo[] = $foo; }
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Cannot use object of type Foo as array in /in/o2cLq:16 Stack trace: #0 {main} thrown in /in/o2cLq on line 16
Process exited with code 255.
Output for 5.4.11 - 5.6.21
Fatal error: Cannot use object of type Foo as array in /in/o2cLq on line 16
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/o2cLq on line 10
Process exited with code 255.