Skip to content

Commit efc8f5d

Browse files
[ErrorHandler] Rewrite logic to dump exception properties and fix serializing FlattenException
1 parent 42237ee commit efc8f5d

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

Caster/ExceptionCaster.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ private static function filterExceptionArray(string $xClass, array $a, string $x
306306
if (empty($a[$xPrefix.'previous'])) {
307307
unset($a[$xPrefix.'previous']);
308308
}
309-
unset($a[$xPrefix.'string'], $a[Caster::PREFIX_DYNAMIC.'xdebug_message'], $a[Caster::PREFIX_DYNAMIC.'__destructorException']);
309+
unset($a[$xPrefix.'string'], $a[Caster::PREFIX_DYNAMIC.'xdebug_message']);
310310

311311
if (isset($a[Caster::PREFIX_PROTECTED.'message']) && str_contains($a[Caster::PREFIX_PROTECTED.'message'], "@anonymous\0")) {
312312
$a[Caster::PREFIX_PROTECTED.'message'] = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', fn ($m) => class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0], $a[Caster::PREFIX_PROTECTED.'message']);

Cloner/VarCloner.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717
class VarCloner extends AbstractCloner
1818
{
19-
private static string $gid;
2019
private static array $arrayCache = [];
2120

2221
protected function doClone(mixed $var): array
@@ -41,7 +40,6 @@ protected function doClone(mixed $var): array
4140
$stub = null; // Stub capturing the main properties of an original item value
4241
// or null if the original value is used directly
4342

44-
$gid = self::$gid ??= hash('xxh128', random_bytes(6)); // Unique string used to detect the special $GLOBALS variable
4543
$arrayStub = new Stub();
4644
$arrayStub->type = Stub::TYPE_ARRAY;
4745
$fromObjCast = false;

0 commit comments

Comments
 (0)