3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // Create an array and push 5 elements on to it, then // print the number of elements in your array to the screen $types_of_fruit = array(); array_push($types_of_fruit, "Apples"); echo $types_of_fruit . "<br />"; array_push($types_of_fruit, "Bananas"); echo $types_of_fruit . "<br />"; array_push($types_of_fruit, "Oranges"); echo $types_of_fruit . "<br />"; array_push($types_of_fruit, "Lemons"); echo $types_of_fruit . "<br />"; array_push($types_of_fruit, "Limes"); echo $types_of_fruit . "<br />"; ?>
Output for 5.4.0 - 7.2.0
Notice: Array to string conversion in /in/V9WS0 on line 6 Array<br /> Notice: Array to string conversion in /in/V9WS0 on line 8 Array<br /> Notice: Array to string conversion in /in/V9WS0 on line 10 Array<br /> Notice: Array to string conversion in /in/V9WS0 on line 12 Array<br /> Notice: Array to string conversion in /in/V9WS0 on line 14 Array<br />
Output for 4.3.0 - 5.3.29
Array<br />Array<br />Array<br />Array<br />Array<br />