3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Test { public function foo() { echo "I am only called once.\n"; return array('a', 'b', 'c', 'd', 'e'); } } $test = new Test(); foreach ($test->foo() as $value) echo $value . "\n"; }
Output for 5.3.0 - 5.5.1
Parse error: syntax error, unexpected '}' in /in/MICMo on line 16
Process exited with code 255.