An equivalent for PHP 7:
<?php
$reflectionProperty = new \ReflectionProperty(Foo::class, 'bar');
//PHP 8:
$defaultValue = $reflectionProperty->getDefaultValue();
//PHP 7:
$defaultValue = $reflectionProperty->getDeclaringClass()->getDefaultProperties()['bar'] ?? null;
?>