skip to Main Content

I updated my php vesrion from 5.6 to 7.3 and now it showing an error
PHP Deprecated: Function create_function() is deprecated in magiczoomplus/magiczoomplus.module.core.class.php on line 78

my code is given below

‘restore-speed’ => create_function(‘&$params’, ‘return $params->checkValue("restore-speed","-1")?$params->getValue("expand-speed"):$params->getValue("restore-speed");’)
));

How do I rewrite my code above for PHP 7.3?

I checked on internet and I didn’t get any solutions. I need replace code on php 7.3

2

Answers


  1. I am not 100% sure about the method of code you use in PHP, but mysql code has been replaced with mysqli

    According to this you should put it in a variable

    $this->code=create_function(/some code/);

    I use the mysqli_query and are still changing codes of older files.

    Hope this put you on the correct path.

    Login or Signup to reply.
  2. 'restore_speed' => function ($params) {
        return $params->checkValue("restore-speed", "-1") ? $params->getValue("expand-speed") : $params->getValue("restore-speed");
    },
    

    It could be something like this 🙂

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search