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?
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.