Помогите справить! Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in \libraries\rokcommon\RokCommon\Serv

Alekxander

Мой дом здесь!
Регистрация
3 Янв 2018
Сообщения
471
Реакции
218
Помогите исправить. Нашёл Для просмотра ссылки Войди или Зарегистрируйся но к сожалению не могу осилить как правильно сделать.
Прошу помощи знатоков.
Вот часть кода, где указана ошибка по строке.
PHP:
459    static public function camelize($id)
460    {
461        return preg_replace(array(
462                                 '/(^|_|-)+(.)/e', '/\.(.)/e'
463                            ), array(
464                                    "strtoupper('\\2')", "'_'.strtoupper('\\1')"
465                               ), $id);
466    }
 
Исправление подсказали на другом форуме.
PHP:
static public function camelize($id)
{
return preg_replace_callback(array('/(^|_|-)+(.)/', '/\.(.)/'), function($matches){
   return array("strtoupper($matches[2])", "'_'.strtoupper($matches[1])");
}, $id);
}
На версии PHP 5.6 ошибка пропала. Решил попробовать PHP версию 7.0
Получилась другая ошибка. (((
Может подскажите по этой?
Warning: Attempt to modify property of non-object in \domain\libraries\rokcommon\RokCommon\Registry.php on line 363
Warning: Attempt to modify property of non-object in \domain\libraries\rokcommon\RokCommon\Registry.php on line 369
PHP:
348  public function set($path, $value)
349    {
350        $result = null;
 
352        // Explode the registry path into an array
        if ($nodes = explode('.', $path))
        {
            // Initialize the current node to be the registry root.
            $node = $this->data;
 
358            // Traverse the registry to find the correct node for the result.
360            for ($i = 0, $n = count($nodes) - 1; $i < $n; $i++)
            {
                if (!isset($node->$nodes[$i]) && ($i != $n))
                {
363                    $node->$nodes[$i] = new stdClass();
                }
                $node = $node->$nodes[$i];
            }
 
            // Get the old value if exists so we can return it
369            $result = $node->$nodes[$i] = $value;
370        }
 
372        return $result;
373    }
 
Большое спасибо. Оперативно. Блин, я не находил. ((( Видимо плохо искал...
 
  • Нравится
Реакции: dmx
Назад
Сверху