3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array(2,1,3); $c = array(); foreach($a as $b){ $b[$a] = $a; } var_dump($c);
Output for 5.3.7 - 7.1.0
Warning: Cannot use a scalar value as an array in /in/f2jHI on line 5 Warning: Cannot use a scalar value as an array in /in/f2jHI on line 5 Warning: Cannot use a scalar value as an array in /in/f2jHI on line 5 array(0) { }