1、preg_replace_callback(): Passing null to parameter #3 ($subject) of type array|string is deprecated
![](https://img.haomeiwen.com/i8562370/84c9bd39ecc7ded0.png)
解决方法:
![](https://img.haomeiwen.com/i8562370/aa8113b4e927314b.png)
![](https://img.haomeiwen.com/i8562370/eb44b7112ffb4ee0.png)
找到报错的位置:\thinkphp\library\think\Loader.php
![](https://img.haomeiwen.com/i8562370/1143cba3a1ba78b8.png)
改成:
![](https://img.haomeiwen.com/i8562370/9004d894aaaa4fdb.png)
2、
![](https://img.haomeiwen.com/i8562370/1eaae1b9cdceae93.png)
解决办法:
model中引入的
use think\model;
改成
use think\console\command\make\Model;
3、类型错误: preg_match(): Argument #2 ($subject) must be of type string, array given
解决办法:
找到文件位置:\thinkphp\library\think\console\Command.php 466
this->diy_to_string($name)
/**
* 验证指令名称
* @param string $name
* @throws \InvalidArgumentException
*/
private function validateName($name)
{
if (!preg_match('/^[^\:]++(\:[^\:]++)*$/', $this->diy_to_string($name))) {
throw new \InvalidArgumentException(sprintf('Command name "%s" is invalid.', $name));
}
}
function diy_to_string($variable)
{
return is_float($variable)?(string)$variable:(is_resource($variable)?"'resource of type'":var_export($variable, true));
}
网友评论