PHP 7.2 Warning on some searches
-
Running PHP 7.2, I am seeing sporadic entries to my error log:
PHP Warning: count(): Parameter must be an array or an object that implements Countable in ________ wp-includes/post-template.php on line 284
I have determined that this error warnings are triggered by some multi-term searches on our site — and I can replicate the error by entering the same search terms in the search field on any page of the site. However, other searches do not trigger the error.
For example, if I found the error triggered by a search for big+black+dogs — I could enter the words: big black dogs – in the search box and the warning will be generated. But if I make a different search — for example, big brown dogs — then I don’t see the error. So I assume that it must be a particular set of search terms that in turn produces results that trigger the PHP 7.2 warning.
I don’t consider this to be a major problem — just a quirk of PHP 7.2 — but it is enough of an annoyance to me that I plan to revert back to PHP 7.1 I’m reporting this simply because it does seem to be a Relevanssi use issue, perhaps only in an edge case scenario.
- The topic ‘PHP 7.2 Warning on some searches’ is closed to new replies.