3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myObject { protected $objects = array; public function add(myObject $object) { $this->objects[] = $object; } } $foo = new myObject; while (true) $foo->addObject($foo);
Output for 5.3.0 - 5.3.25, 5.4.0 - 5.4.15
Parse error: syntax error, unexpected ';', expecting '(' in /in/NEn1U on line 5
Process exited with code 255.

preferences:
197.67 ms | 1395 KiB | 49 Q