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]); echo " \n"; echo (is_array($cars[0]) ? 'true' : 'false'); echo " \n"; echo (is_array($cars1[0]) ? 'true' : 'false');
based on fMbsN
Output for 7.2.0
3 Warning: count(): Parameter must be an array or an object that implements Countable in /in/rG4RW on line 7 1 1 3 false true
Output for 5.3.19 - 7.1.10
3 1 1 3 false true