Skip to content

Conversation

@Art-Sel
Copy link

@Art-Sel Art-Sel commented Oct 20, 2021

$metadata != unserialize(serialize($metadata))

Not fill propertyMetadata.serializedName

Q A
Bug fix? yes/no
New feature? yes/no
Doc updated yes/no
BC breaks? yes/no
Deprecations? yes/no
Tests pass? yes/no
Fixed tickets #...
License MIT

$metadata != unserialize(serialize($metadata))

Not fill propertyMetadata.serializedName
@psychorama
Copy link

psychorama commented Oct 30, 2025

Stumbled upon this fix. This also fixes "Error: Maximum call stack size reached. Infinite recursion?"

--- a/src/SerializationHelper.php
+++ b/src/SerializationHelper.php
@@ -28,14 +28,17 @@ trait SerializationHelper
         $this->unserializeFromArray(unserialize($str));
     }

     public function __serialize(): array
     {
-        return [$this->serialize()];
+        return $this->serializeToArray();
     }

     public function __unserialize(array $data): void
     {
-        $this->unserialize($data[0]);
+        $this->unserializeFromArray($data);
     }
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants