3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Test { public function foo() { echo "I was just called.<br>"; return array('a', 'b', 'c', 'd', 'e'); } } $test = new Test(); foreach ($test->foo() as $value) { echo $value . "<br>"; }
Output for 5.2.15 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
I was just called.<br>a<br>b<br>c<br>d<br>e<br>