Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-5753

PHP 8.1 deprecated warning about return type in jsonSerialize functions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 0.20.0
    • PHP - Library
    • None

    Description

      In PHP 8.1 a "mixed" return type was added to the "JsonSerializable::jsonSerialize()" method.

      This triggers a deprecation warning for generated PHP classes:

      Return type of TestClass::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ...

      Attachments

        Issue Links

          Activity

            People

              pkvach Pavel Kvach
              pkvach Pavel Kvach
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m