3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr1=array(1,2,3,4,5); $arr2=array("a","b","c","d","e"); $arr3=array("x","y","z","p","q"); foreach($arr1 as $val1) { echo $val1."\n"; foreach($arr2 as $val2) { echo $val2."<br>"; foreach($arr3 as $val3) { echo $val3."<br>"; } } }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
1 a<br>x<br>y<br>z<br>p<br>q<br>b<br>x<br>y<br>z<br>p<br>q<br>c<br>x<br>y<br>z<br>p<br>q<br>d<br>x<br>y<br>z<br>p<br>q<br>e<br>x<br>y<br>z<br>p<br>q<br>2 a<br>x<br>y<br>z<br>p<br>q<br>b<br>x<br>y<br>z<br>p<br>q<br>c<br>x<br>y<br>z<br>p<br>q<br>d<br>x<br>y<br>z<br>p<br>q<br>e<br>x<br>y<br>z<br>p<br>q<br>3 a<br>x<br>y<br>z<br>p<br>q<br>b<br>x<br>y<br>z<br>p<br>q<br>c<br>x<br>y<br>z<br>p<br>q<br>d<br>x<br>y<br>z<br>p<br>q<br>e<br>x<br>y<br>z<br>p<br>q<br>4 a<br>x<br>y<br>z<br>p<br>q<br>b<br>x<br>y<br>z<br>p<br>q<br>c<br>x<br>y<br>z<br>p<br>q<br>d<br>x<br>y<br>z<br>p<br>q<br>e<br>x<br>y<br>z<br>p<br>q<br>5 a<br>x<br>y<br>z<br>p<br>q<br>b<br>x<br>y<br>z<br>p<br>q<br>c<br>x<br>y<br>z<br>p<br>q<br>d<br>x<br>y<br>z<br>p<br>q<br>e<br>x<br>y<br>z<br>p<br>q<br>