1、报错: Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead
将:return preg_replace("/{([^}{n]*)}/e", "$this->select('1');", $source);
改为:
return preg_replace_callback("/{([^}{n]*)}/", function($r) { return $this->select($r[1]); }, $source);
2、错误:Strict Standards: Only variables should be passed by reference
将$tag_sel = array_shift(explode(' ', $tag));
改为:
$tagArr = explode(' ', $tag); $tag_sel = array_shift($tagArr);
3、错误:Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead
将$val = preg_replace("/[([^[]]*)]/eis", "'.'.str_replace('$','$','1')", $val);
改为:$val = preg_replace_callback("/[([^[]]*)]/", function($r) {return '.'.str_replace('$','$',$r[1]);}, $val);
4、报错:Strict Standards: Redefining already defined constructor for class cls_sql_dump
解决:把__construct()函数放在,同名函数上面就行了。
5、报错:Strict Standards: Non-static method cls_sql_dump::get_random_name() should not be called statically
解决: function get_random_name()改为: static function get_random_name()
6、報錯:Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead
解决:
$pattern = '/.*?/se';
$replacement = "'{include file='.strtolower('1'). '}'";
$source = preg_replace($pattern, $replacement, $source);
改为:
$pattern = '/.*?/s';
$replacement = function($r){return '{include file='.strtolower($r[1]). '}';};
$source = preg_replace_callback($pattern, $replacement, $source);
7、报错:Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead
解决:$out = "<?php n" . '$k = ' . preg_replace("/('$[^,]+)/e" , "stripslashes(trim('1','''));", var_export($t, true)) . ";n";
改为:$out = "<?php n" . '$k = ' . preg_replace_callback("/('$[^,]+)/", function($r) { return stripslashes(trim($r[1],''')); }, var_export($t, true)) . ";n";
8、报错:Strict Standards: Only variables should be passed by reference
將:$tag_sel = array_shift(explode(' ', $tag));
改爲:$tagArr = explode(' ', $tag);$tag_sel = array_shift($tagArr);
9、报错:Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead
将: return preg_replace("/{([^}{n]*)}/e", "$this->select('1');", $source);
改为:return preg_replace_callback("/{([^}{n]*)}/", function($r) { return $this->select($r[1]); }, $source);
本文版权所有,转载须注明:来源 https://www.qvdv.net/qvdv-oop-825.html