1--TEST-- 2Only arrays and countable objects can be counted 3--FILE-- 4<?php 5 6$result = count(null); 7var_dump($result); 8 9$result = count("string"); 10var_dump($result); 11 12$result = count(123); 13var_dump($result); 14 15$result = count(true); 16var_dump($result); 17 18$result = count(false); 19var_dump($result); 20 21$result = count((object) []); 22var_dump($result); 23 24?> 25--EXPECTF-- 26Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d 27int(0) 28 29Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d 30int(1) 31 32Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d 33int(1) 34 35Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d 36int(1) 37 38Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d 39int(1) 40 41Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d 42int(1) 43