wyclef
-
Posts
2 -
Joined
-
Last visited
Posts posted by wyclef
-
-
Hello, I’m getting a fatal error when upgrading from PHP 7.4 to PHP 8: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in...
on the following count line.
function orderByDate($items) { //$tempDate = strtotime($item); $referenceArray = array(); for ($i = 0; $i < count($items); $i++) { $referenceArray[] = strtotime($items[$i]['pubDate']); } array_multisort($referenceArray, SORT_DESC, $items); return $items; }
Anyone know how to resolve this?
PHP 8 Fatal Error
in PHP Coding Help
Posted
I think this fixes it? testing now... how does this look?