thinkPHP验证器报错filter_var(): Argument #3 ($options) must be of type array|int, null given
这两天在写一个系统,用到了thinkPHP
的验证器,环境是PHP8
,所以就遇到了一个报错 TypeError: filter_var(): Argument #3 ($options) must be of type array|int, null given in
,原因是在PHP8
中的强类型模式中filter_var()
的第三个参数默认是array|int
,所以不能赋值为null
解决
修改验证器的源代码,将参数修改为0就行,大概在970多行,或者直接检索filter
函数
当前页面是本站的「Google AMP」版。查看和发表评论请点击:完整版 »