Skip to content

Commit d7bc61d

Browse files
Merge branch '4.4' into 5.0
* 4.4: [Config] improve perf of glob discovery when GLOB_BRACE is not available use utf8mb4_bin to align code with documentation [HttpClient] make pushed responses retry-able [VarDumper] ignore failing __debugInfo()
2 parents d7674d8 + be330f9 commit d7bc61d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Caster/Caster.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ class Caster
4646
*/
4747
public static function castObject(object $obj, string $class, bool $hasDebugInfo = false): array
4848
{
49+
if ($hasDebugInfo) {
50+
try {
51+
$debugInfo = $obj->__debugInfo();
52+
} catch (\Exception $e) {
53+
// ignore failing __debugInfo()
54+
$hasDebugInfo = false;
55+
}
56+
}
57+
4958
$a = $obj instanceof \Closure ? [] : (array) $obj;
5059

5160
if ($obj instanceof \__PHP_Incomplete_Class) {
@@ -81,7 +90,7 @@ public static function castObject(object $obj, string $class, bool $hasDebugInfo
8190
}
8291
}
8392

84-
if ($hasDebugInfo && \is_array($debugInfo = $obj->__debugInfo())) {
93+
if ($hasDebugInfo && \is_array($debugInfo)) {
8594
foreach ($debugInfo as $k => $v) {
8695
if (!isset($k[0]) || "\0" !== $k[0]) {
8796
$k = self::PREFIX_VIRTUAL.$k;

0 commit comments

Comments
 (0)