Skip to content

Commit 49055d9

Browse files
[DeepClone] Add XMLWriter, XMLReader, SNMP, tidy, tidyNode to NOT_ROUND_TRIPPABLE
These classes wrap native C handles and silently lose state through property restoration. Matches php/php-src#21694 which adds NOT_SERIALIZABLE to them; the explicit list protects older PHP versions where the flag isn't set yet.
1 parent b25b14f commit 49055d9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/DeepClone/DeepClone.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ final class DeepClone
3535
* losing the underlying file handle / connection / archive / etc.
3636
*/
3737
private const NOT_ROUND_TRIPPABLE = [
38-
\ZipArchive::class => true,
38+
'ZipArchive' => true,
39+
'XMLWriter' => true,
40+
'XMLReader' => true,
41+
'SNMP' => true,
42+
'tidy' => true,
43+
'tidyNode' => true,
3944
];
4045

4146
private static array $reflectors = [];

0 commit comments

Comments
 (0)