diff --git a/src/Symfony/Component/VarDumper/Caster/Caster.php b/src/Symfony/Component/VarDumper/Caster/Caster.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/VarDumper/Caster/Caster.php
+++ b/src/Symfony/Component/VarDumper/Caster/Caster.php
@@ -53,13 +53,9 @@ class Caster
             $hasDebugInfo = $class->hasMethod('__debugInfo');
             $class = $class->name;
         }
-        if ($hasDebugInfo) {
-            $a = $obj->__debugInfo();
-        } elseif ($obj instanceof \Closure) {
-            $a = [];
-        } else {
-            $a = (array) $obj;
-        }
+
+        $a = $obj instanceof \Closure ? [] : (array) $obj;
+
         if ($obj instanceof \__PHP_Incomplete_Class) {
             return $a;
         }
@@ -93,6 +89,17 @@ class Caster
             }
         }
 
+        if ($hasDebugInfo && \is_array($debugInfo = $obj->__debugInfo())) {
+            foreach ($debugInfo as $k => $v) {
+                if (!isset($k[0]) || "\0" !== $k[0]) {
+                    $k = self::PREFIX_VIRTUAL.$k;
+                }
+
+                unset($a[$k]);
+                $a[$k] = $v;
+            }
+        }
+
         return $a;
     }
[VarDumper] fix dumping objects that implement __debugInfo()