PHPverse 2025

Voting

: min(six, six)?
(Example: nine)

The Note You're Voting On

Anonymous
5 years ago
For a Non Countable Objects

$count = count($data);
print "Count: $count\n";

Warning: count(): Parameter must be an array or an object that implements Countable in example.php on line 159

#Quick fix is to just cast the non-countable object as an array..

$count = count((array) $data);
print "Count: $count\n";

Count: 250

<< Back to user notes page

To Top