Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eb2eb76

Browse filesBrowse files
[VarDumper] ignore failing __debugInfo()
1 parent ae9c41c commit eb2eb76
Copy full SHA for eb2eb76

File tree

1 file changed

+10
-1
lines changed
Filter options

1 file changed

+10
-1
lines changed

‎src/Symfony/Component/VarDumper/Caster/Caster.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/VarDumper/Caster/Caster.php
+10-1Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ public static function castObject($obj, $class, $hasDebugInfo = false)
5454
$class = $class->name;
5555
}
5656

57+
if ($hasDebugInfo) {
58+
try {
59+
$debugInfo = $obj->__debugInfo();
60+
} catch (\Exception $e) {
61+
// ignore failing __debugInfo()
62+
$hasDebugInfo = false;
63+
}
64+
}
65+
5766
$a = $obj instanceof \Closure ? [] : (array) $obj;
5867

5968
if ($obj instanceof \__PHP_Incomplete_Class) {
@@ -89,7 +98,7 @@ public static function castObject($obj, $class, $hasDebugInfo = false)
8998
}
9099
}
91100

92-
if ($hasDebugInfo && \is_array($debugInfo = $obj->__debugInfo())) {
101+
if ($hasDebugInfo && \is_array($debugInfo)) {
93102
foreach ($debugInfo as $k => $v) {
94103
if (!isset($k[0]) || "\0" !== $k[0]) {
95104
$k = self::PREFIX_VIRTUAL.$k;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.