0

Hello when installing my script I'm getting the following error:

ErrorException in Util.php line 206: Function create_function () is deprecated

my code

{
    // php doesn't garbage collect functions created by create_function ()
    // so use a static variable to avoid adding a new function to memory
    // every time this function is called.
    static $ callbacks = array ();
    if (! isset ($ callbacks [$ delimiter])) {
        $ callbacks [$ delimiter] = create_function ('$ matches', "return '$ delimiter'. strtolower (\ $ matches [1]);");
    }

    return preg_replace_callback ('/ ([A-Z]) /', $ callbacks [$ delimiter], $ string);
}
  • already tried but then returns me another error new error: FatalThrowableError in Util.php line 206: Parse error: syntax error, unexpected '' $ matches '' (T_CONSTANT_ENCAPSED_STRING), expecting variable (T_VARIABLE) – augusto souza Oct 23 '20 at 17:03
  • already tried but then returns me another error code: // php doesn't garbage collect functions created by create_function () // so use a static variable to avoid adding a new function to memory // every time this function is called. static $ callbacks = array (); if (! isset ($ callbacks [$ delimiter])) { $ callbacks [$ delimiter] = function ('$ matches', return '$ delimiter'. strtolower (\ $ matches [1]); "); } – augusto souza Oct 23 '20 at 17:04

0 Answers0