PHP 8.1 changes the order of protected properties in the output of serialize(). Previously they were at the end of the serialized stream, now they are at the beginning. Given that serialization formats have multiple equivalent encodings, and there is no guarantee that they might not arbitrary change between versions in backwards compatible ways, I think we should not do byte for byte comparisons. Instead we should deserialize both and compare the resulting objects for equality. This should test what we want to know (That we can read serialized structures) well also being safe against compatible format changes. This fixes a number of failing ParserOutputTest::testSerialization on php 8.1. Bug: T313663 Change-Id: Ic7a08b436d65ab7492f343fa02281e245834aaea |
||
|---|---|---|
| .. | ||
| SerializationTestTrait.php | ||
| SerializationTestUtils.php | ||