eyecatchup / SEOstats

SEOstats is a powerful open source PHP library to request a bunch of SEO relevant metrics.
MIT License
1.47k stars 387 forks source link

sizeof(): Parameter must be an array or an object that implements Countable #162

Open Helle1 opened 3 years ago

Helle1 commented 3 years ago

seostats/seostats/SEOstats/Services/3rdparty/GTB_PageRank.php:297

with php 7.2 in the dev-master of SEOstats...

Helle1 commented 3 years ago

I cannot find a workaround for that ... It seems that the method public static function _jenkinsHash($key, $encode=TRUE) { is called several times and on the first call it gets an array, and on second a string ...

This is how I use it:


 $seostats = new SEOstats;
 if ($seostats->setUrl($websiteUrl)) {
     echo = SEOstatsGoogle::getPageRank();
}

maybe related to https://www.php.net/manual/de/function.count.php the change in php 7.2 saying

count() will now yield a warning on invalid countable types passed to the value parameter.

While, sizeof is an alias of count.