加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

DuringinheritanceofJsonSerializable:Uncaughtthink\exception\ErrorExcept

(2023-04-23 23:27:52)
分类: PHP-GO

解决方法:

1.  原因是php版本太高8.1以上,可以通过降级完成。

2.  不降级的处理方案

You don't have to downgrade your PHP version unless you are using some third-party components also using jsonSerialize() and they are not able to fix it.

Here is what I did to fix it:

 


public function jsonSerialize():mixed
{
// Some snippet here
return $your_type;
}

Just give jsonSerialize() a return type, or mixed works just fine.

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有