3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $foo = array('first', 'second'); // First time, break after first foreach ($foo as $bar) { if ($bar == 'first') break; } foreach($foo as $bar) { var_dump('First element in this iteration: ', $bar); }
Output for 4.3.0 - 7.1.0
string(33) "First element in this iteration: " string(5) "first" string(33) "First element in this iteration: " string(6) "second"