3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $cars=array("Volvo","BMW","Toyota"); $cars1=array(0 => array("Volvo","BMW","Toyota"), 1 => array('lksdjf')); 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 rG4RW
Output for 7.2.0
3 Warning: count(): Parameter must be an array or an object that implements Countable in /in/EfgvM on line 7 1 2 3 false true
Output for 5.3.19 - 7.1.10
3 1 2 3 false true