DuringinheritanceofJsonSerializable:Uncaughtthink\exception\ErrorExcept
(2023-04-23 23:27:52)分类: PHP-GO |
解决方法:
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.