Skip to content

Commit

Permalink
Fix uninitialized typed property
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghostff committed Feb 8, 2020
1 parent 4fab72d commit 08c237c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Dump.php
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,16 @@ private function formatObject($object)
}

$prop->setAccessible(true);
$new_obj = $prop->getValue($object);
$tmp .= "{$from} {$this->color("'{$prop->getName()}'", 'property_name')} {$arrow_color} {$this->evaluate(array($new_obj), true, true)}";
if ($prop->isInitialized($object))
{
$value = $this->evaluate(array($prop->getValue($object)), true, true);
}
else
{
$value = $this->type('uninitialized');
}

$tmp .= "{$from} {$this->color("'{$prop->getName()}'", 'property_name')} {$arrow_color} {$value}";
}

if ($tmp != '')
Expand Down

0 comments on commit 08c237c

Please sign in to comment.