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'); foreach($arr1 AS $key=>$val) { echo "$key => $val \r\n"; if( $val === 5) { $new = &$arr1; $new = $arr2; } }
Output for 4.3.0 - 7.1.0
0 => 1 1 => 2 2 => 3 3 => 4 4 => 5