• Resolved Malae

    (@malae)


    Hello Cory,

    About 3 months ago, I posted the following and you said you would take a look. It was closed as resolved, but I still get the warnings. I could not find any further reference or reply. Perhaps the code is for backward compatibility and these are false positives. Can you confirm.

    Please be advised of the following warnings in PHP 7.2:

    FILE: /wp-content/plugins/duplicator/installer/build/classes/class.engine.php
    -----------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------
     149 | WARNING | Function create_function() is deprecated since PHP 7.2; Use an anonymous function instead
    -----------------------------------------------------------------------------------------------------------
    
    FILE: /wp-content/plugins/duplicator/lib/forceutf8/Encoding.php
    -------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------
     303 | WARNING | INI directive 'mbstring.func_overload' is deprecated since PHP 7.2
    -------------------------------------------------------------------------------------------
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hey @malae,

    We did replace the function in a few places where the risk was low. Overall they are just warnings and do not affect PHP in a negative way. It just means at some point in PHPs future they might be removed like in PHP 8 or some distant version. At some point we will refactor the code until then it should still be safe.

    Thanks

    Thread Starter Malae

    (@malae)

    Hello Cory,

    Thank you for your fast response.

    First of all I apologise for not having checked again first. In the PHP files I found that the lines that I had quoted above with the deprecated create_function have now been pushed lower down.

     // Let's use anonymous function after PHP5.3.0 - is faster than create_function()
            // create_function() is removed from PHP 7.2
            if(DUPX_U::isVersion('5.3.0')) {
                // Use "try catch" to avoid PHP notice or error below PHP5.3.0
                try {
                    $walk_function = function () use (&$str) {
                        $str = "<code>$str</code>";
                    };
                }
    			catch (Exception $exc) {}
            } else {
                $walk_function = create_function('&$str', '$str = "<code>$str</code>";');
            } 

    I presume that the remaining create_function and the mbstring.func_overload are there for backward compatibility.

    • This reply was modified 8 years, 1 month ago by Malae.

    At the moment that is correct. We hope to just write one types that supports all versions.

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Warnings in PHP 7.2’ is closed to new replies.