3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $x = array(1, 2, 3, 4, 5); $len=$x.count(); echo "array[$len]"; foreach($x as $key=>$int) echo "[$key] => $int"; unset($x[3]); $len=$x.count(); echo "array[$len]"; foreach($x as $key=>$int) echo "[$key] => $int"; ?>
Output for 5.4.0 - 7.1.0
Warning: count() expects at least 1 parameter, 0 given in /in/5tiTH on line 3 Notice: Array to string conversion in /in/5tiTH on line 3 array[Array][0] => 1[1] => 2[2] => 3[3] => 4[4] => 5 Warning: count() expects at least 1 parameter, 0 given in /in/5tiTH on line 8 Notice: Array to string conversion in /in/5tiTH on line 8 array[Array][0] => 1[1] => 2[2] => 3[4] => 5
Output for 4.3.0 - 5.3.29
Warning: count() expects at least 1 parameter, 0 given in /in/5tiTH on line 3 array[Array][0] => 1[1] => 2[2] => 3[3] => 4[4] => 5 Warning: count() expects at least 1 parameter, 0 given in /in/5tiTH on line 8 array[Array][0] => 1[1] => 2[2] => 3[4] => 5