Function create_function() is deprecated in PHP 7.2.0, message error in the Control Painel using Low Variables
Function create_function() is deprecated in php 7.2.0
Using the great Low Variables with EE 3.5.15 and PHP 7.2, appears this message error:
Warning
count(): Parameter must be an array or an object that implements Countable
D:/sites/cistoarac/system/user/addons/stash/mod.stash.php, line 843 show details
Severity: E_WARNING
As Function create_function() is deprecated in php 7.2.0 it's why this error message appears. Reading the PHP.net manual http://php.net/manual/en/migration72....
I transformed the create_function into an anonymous one:
from: uasort($this->_types, create_function(
'$a, $b',
'return strcasecmp($a["name"], $b["name"]);'
));
to:
uasort ( $this->_types, function ( $a, $b ) {
return strcasecmp ( $a[ "name" ], $b[ "name" ] );
} );
With this modification, no more message error displayed on the EE Control Painel.
Using PHP 7.1, no message error appears at all.
Replies
Low 23 Apr 2018 06:06
Thanks for the report. Will update LV accordingly.
Stéphane Cabaret 23 Apr 2018 14:00
Hi Low,
Thanks for your fast reply and your wonderful add-ons ! And your great support !
Have a good week !
Low 24 Apr 2018 08:00
Fixed in 3.2.0
Stéphane Cabaret 24 Apr 2018 13:56
Hi Low,
Thanks a lof for your eficiency !