MemoryDump: fixed duplicated properties, reduce useless noise

This commit is contained in:
Dylan K. Taylor 2020-07-13 11:44:21 +01:00
parent 46c4c65022
commit efd67a132e

View File

@ -406,22 +406,16 @@ class MemoryManager{
"properties" => []
];
for($original = $reflection; $reflection !== false; $reflection = $reflection->getParentClass()){
foreach($reflection->getProperties() as $property){
if($property->isStatic()){
continue;
}
$name = $property->getName();
if($reflection !== $original and !$property->isPublic()){
$name = $reflection->getName() . ":" . $name;
}
if(!$property->isPublic()){
$property->setAccessible(true);
}
$info["properties"][$name] = self::continueDump($property->getValue($object), $objects, $refCounts, 0, $maxNesting, $maxStringSize);
foreach($reflection->getProperties() as $property){
if($property->isStatic()){
continue;
}
if(!$property->isPublic()){
$property->setAccessible(true);
}
$info["properties"][$property->getName()] = self::continueDump($property->getValue($object), $objects, $refCounts, 0, $maxNesting, $maxStringSize);
}
fwrite($obData, json_encode($info, JSON_UNESCAPED_SLASHES) . "\n");