PHP 7.2 Warning: count()
-
Hey,
PHP 7.2 adds a new error when trying to
count(null)
. This is in our logs:PHP Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/oursite/wp-content/plugins/oauth2-provider/library/OAuth2/Server.php on line 458
For this line:
protected function createDefaultAuthorizeController() { ... if (0 == count( $this->responseTypes ) ) {
And running
error_log
shows$this->responseTypes
is null.Is it ok to be null or do I have a deeper issue? Is nothing equal to zero?! I was tempted to rewrite the line as:
if ( $this->responseTypes == null || 0 == count( $this->responseTypes ) ) {
Thanks for the plugin.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘PHP 7.2 Warning: count()’ is closed to new replies.