Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-2252

Fix method signature for Serializable::unserialize() implementations

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 1.16.0
    • Affects Version/s: None
    • Component/s: None
    • None

      In PHP 8, the method signature of Serializable::unserialize changed:

      // PHP < 8
      public function unserialize($serialized);
      
      // PHP >= 8
      public function unserialize(string $data): void;
      

      This causes issues in newer applications about the changed parameter name. Since parameter names have increased significance after the introduction of named arguments, we should implement the correct method signature in all classes implementing the interface. To avoid BC breaks on older platforms where Serializable::unserialize does not have a parameter type, this change can only be made for PHP >= 8.

      Downstream users are not affected, as our implementations of this method are always final.

            Assignee:
            andreas.braun@mongodb.com Andreas Braun
            Reporter:
            andreas.braun@mongodb.com Andreas Braun
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: