Php preg_replace_回调只需要5个参数?

Php preg_replace_回调只需要5个参数?,php,preg-replace,Php,Preg Replace,我用如下6个参数编写preg_replace_回调 $aTagPattern = '/<a[^>]*(href=["\']([^"\']*))+[^>]*>([^<]*)<\/a>/'; $content3 = preg_replace_callback($aTagPattern,"next_year",$content,-1,$count,PREG_OFFSET_CAPTURE); 但是preg_replac

我用如下6个参数编写preg_replace_回调

$aTagPattern = '/<a[^>]*(href=["\']([^"\']*))+[^>]*>([^<]*)<\/a>/';

$content3 = preg_replace_callback($aTagPattern,"next_year",$content,-1,$count,PREG_OFFSET_CAPTURE);
但是preg_replace_回调函数的decaration表示它需要6个参数,而不是5个:

function preg_replace_callback ($regex, callable $callback, $subject, $limit = -1, &$count = null, $flags=[]) {}
此错误是如何发生的?

来自:

版本7.4.0添加了flags参数

升级您的php版本


理想情况下,您不应该使用preg_uu函数来修改有效的html文档。您应该使用合法的dom解析器。

备份总线。。。你为什么要用preg_u________________________________!我使用preg_uu对一些特定的标记进行了一些替换-uu-这个任务有DOM解析器。帮你自己一个忙,试试看。看看语法有多干净。。。
function preg_replace_callback ($regex, callable $callback, $subject, $limit = -1, &$count = null, $flags=[]) {}