[php-src] Issue #14178: PHP version 8.2.18 breaks with error "Deprecated: Use of "static" in callables is deprecated"
| From: | jfernandezr | Date: | Wed, 08 May 2024 11:47:23 +0000 |
| Subject: | [php-src] Issue #14178: PHP version 8.2.18 breaks with error "Deprecated: Use of "static" in callables is deprecated" | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-246879@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/14178
Author: jfernandezr
### Description
Hi. I've been working on a Wordpress site by using the Docker Hub instance version
6.5.2-php8.2, specifically PHP_VERSION=8.2.17. The site was working fine, until the image in Docker
Hub was reconfigured to use PHP_VERSION=8.2.18, which is a minor release, and then the following
error displays
Deprecated: Use of "static" in callables is deprecated in
/var/www/html/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-views/src/Fields/BaseRenderer.php
on line 11. The affected code is the following
```
<?php
namespace MBViews\Fields;
use RWMB_Field;
class BaseRenderer {
public static $field;
public static function parse( $value, $field ) {
self::$field = $field;
return $field['clone'] ? array_map( 'static::get_clone_value', (array) $value
) : static::get_clone_value( $value );
}
public static function get_clone_value( $clone ) {
return self::$field['multiple'] ? array_map( 'static::get_single_value',
(array) $clone ) : static::get_single_value( $clone );
}
public static function get_single_value( $value ) {
return RWMB_Field::call( 'format_single_value', self::$field, $value, [], null );
}
}
```
Of course it should be the responsability of the plugin developers to remove deprecated code, but
this patch version change should not change the warning to be an error.
### PHP Version
PHP 8.2.18
### Operating System
Debian 12