All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Function create_function() is deprecated in PHP 7.2.0, message error in the Control Painel using Low Variables

Stéphane Cabaret 21 Apr 2018 03:04 problem, complete

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

  1. Low 23 Apr 2018 06:06

    Thanks for the report. Will update LV accordingly.

  2. 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 !

  3. Low 24 Apr 2018 08:00

    Fixed in 3.2.0

  4. Stéphane Cabaret 24 Apr 2018 13:56

    Hi Low,

    Thanks a lof for your eficiency !