3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array(1,2,1,3,2,1,3,2,1,3,2,1,2,3,1,2,3); foreach($a as $k => $v) { echo "Found $v at index $k\n"; }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Found 1 at index 0 Found 2 at index 1 Found 1 at index 2 Found 3 at index 3 Found 2 at index 4 Found 1 at index 5 Found 3 at index 6 Found 2 at index 7 Found 1 at index 8 Found 3 at index 9 Found 2 at index 10 Found 1 at index 11 Found 2 at index 12 Found 3 at index 13 Found 1 at index 14 Found 2 at index 15 Found 3 at index 16