3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array( 1=>" vahid ", 2=>" arash ", 3=>" farzam " ); foreach($a as $b){ echo "First Foreach: ". $b . "<br>"; foreach($a as $c){ echo "Second Foreach: ". $c . "<br>"; } }
Output for 4.3.0 - 7.1.0
First Foreach: vahid <br>Second Foreach: vahid <br>Second Foreach: arash <br>Second Foreach: farzam <br>First Foreach: arash <br>Second Foreach: vahid <br>Second Foreach: arash <br>Second Foreach: farzam <br>First Foreach: farzam <br>Second Foreach: vahid <br>Second Foreach: arash <br>Second Foreach: farzam <br>