PHP 7.2.x: Parameter must be an array or an object that implements Countable
-
The working environment is WAMP/PHP7.2.4. I’m getting the following message during rename:
PHP Warning: count(): Parameter must be an array or an object that implements Countable in \plugins\phoenix-media-rename\class-media-rename.php on line 392
Changing the concerning line from this:
if (!is_scalar($subj) && count($subj)) {
to this:
if ( !is_scalar($subj) && ($subj instanceof Countable) && count($subj) ) {
seems to fix the issue for me.
Thank you.UPDATE: the traffic was huge and missed a case. Now should work better. Tested with PHP5.6.35 and PHP7.2.4
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘PHP 7.2.x: Parameter must be an array or an object that implements Countable’ is closed to new replies.