3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $x = array(-3,5,1,3,2,10); function array_rev($array) { for ($i = 0; $i <= count($array)/2; $i++) { $holder = $array[$i]; $array[i] = $array[count($array) - ($i + 1)]; $array[count($array) - ($i + 1)] = $holder; } echo $array; } array_rev($x);
based on SQaBV
Output for 5.4.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Use of undefined constant i - assumed 'i' in /in/ELuAt on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/ELuAt on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/ELuAt on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/ELuAt on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/ELuAt on line 7 Notice: Array to string conversion in /in/ELuAt on line 10 Array
Output for 4.3.0 - 5.3.29
Notice: Use of undefined constant i - assumed 'i' in /in/ELuAt on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/ELuAt on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/ELuAt on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/ELuAt on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/ELuAt on line 7 Array