<?php class Foo { public function __construct( private string $bar = 'content', ) { } } $class = new \ReflectionClass(Foo::class); $properties = $class->getProperties(); var_dump($properties[0]->getDefaultValue()); // not working $constructMethod = $class->getMethod('__construct'); $parameters = $constructMethod->getParameters(); var_dump($parameters[0]->getDefaultValue());
You have javascript disabled. You will not be able to edit any code.