3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array(1,3,2,8,5,7,4,0); $array_length = count($arr); for ($i=0; $i<$array_length; $i++) { for ($j=0; $j<$array_length-1-$i; $j++) { if ($arr[$j+1] < $arr[$j]) { $tmp = $arr[$j]; $arr[$j] = $arr[$j+1]; $arr[$j+1] = $tmp; } } } var_dump(arr);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Use of undefined constant arr - assumed 'arr' in /in/1AeuN on line 13 string(3) "arr"