Jump to content

Deprecated: Function create_function() is deprecated in classes/module/Module.php on line 1554


cleoni
 Share

Recommended Posts

Hello,

I am using PS 1.6.1.24

While accessing the Modules section I see this message flashing in the top of the screen, a "show source" brings this deprecated (which I thought I had disabled)

 

Quote

Deprecated: Function create_function() is deprecated in (path)/classes/module/Module.php on line 1554

 

The line is this

        usort($module_list, create_function('$a,$b', 'return strnatcasecmp($a->displayName, $b->displayName);'));


 

I know it's not a big issue, but since I have this

 

@error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED);

at the beginning of config.inc.php, I did not expect to see this.

 

Any suggestions?

Share this post


Link to post
Share on other sites

  • 6 months later...

Hi. You can change the line

usort($module_list, create_function('$a,$b', 'return strnatcasecmp($a->displayName, $b->displayName);'));

 

for this other line:

usort($module_list, function($a, $b){ return strnatcasecmp($a->displayName, $b->displayName); });

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More