3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array(1 => 'test', 'to' => 'to', 5 => 'fem', 6 => 6); foreach ($arr as $key => $item) { echo("<p>Key is: " . $key . " with value=" . $item . "</p>"); }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<p>Key is: 1 with value=test</p><p>Key is: to with value=to</p><p>Key is: 5 with value=fem</p><p>Key is: 6 with value=6</p>