In PHP 8.1, we need to add the mixed return type to the jsonSerialize implementation. The mixed return type is not supported in older versions. It is possible to suppress the deprecation warning by adding a PHP attribute. Older PHP versions will interpret attributes as a comment.
In PHP 8.1, we need to add the mixed return type to the jsonSerialize implementation. The mixed return type is not supported in older versions. It is possible to suppress the deprecation warning by adding a PHP attribute. Older PHP versions will interpret attributes as a comment.