3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $cars=array("Volvo","BMW","Toyota"); $cars1=array(0 => array("Volvo","BMW","Toyota")); echo count($cars); echo " \n"; echo count($cars[0]); echo " \n"; echo count($cars1); echo " \n"; echo count($cars1[0]);
Output for 7.2.0
3 Warning: count(): Parameter must be an array or an object that implements Countable in /in/0ffc5 on line 7 1 1 3
Output for 5.3.19 - 7.1.10
3 1 1 3