mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice i

During inheritance of JsonSerializable: Uncaught think\exception\ErrorException: Return type of think\Model::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /opt/www/data/thinkphp/library/think/Model.php:1438
Stack trace:
#0 /opt/www/data/thinkphp/library/think/Model.php(40): think\Error::appError(8192, 'Return type of ...', '/opt/www/data/t...', 1438)
#1 /opt/www/data/thinkphp/library/think/Loader.php(544): include('/opt/www/data/t...')
#2 /opt/www/data/thinkphp/library/think/Loader.php(58): think\__include_file('/opt/www/data/t...')
#3 /opt/www/data/application/admin/model/Admin.php(7): think\Loader::autoload('think\\Model')
#4 /opt/www/data/thinkphp/library/think/Loader.php(544): include('/opt/www/data/a...')
#5 /opt/www/data/thinkphp/library/think/Loader.php(58): think\__include_file('/opt/www/data/p...')
#6 /opt/www/data/application/admin/controller/Admin.php(319): think\Loader::autoload('app\\admin\\model...')
#7 [internal function]: app\admin\controller\Admin->getAllTowns()
#8 /opt/www/data/thinkphp/library/think/App.php(226): ReflectionMethod->invokeArgs(Object(app\admin\controller\Admin), Array)
#9 /opt/www/data/thinkphp/library/think/App.php(364): think\App::invokeMethod(Array)
#10 /opt/www/data/thinkphp/library/think/App.php(134): think\App::module(Array, Array, true)
#11 /opt/www/data/thinkphp/start.php(18): think\App::run()
#12 /opt/www/data/public/index.php(18): require('/opt/www/data/t...')
#13 {main}

 解决办法:

Tp5在Linux部署报错During inheritance of JsonSerializable: Uncaught think\exception\ErrorException_荒-漠的博客-CSDN博客

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值