3v4l.org

run code in 300+ PHP versions simultaneously
<?php class PhpClassWithPropertyDefaults { public $propertyWithoutDefault; public $propertyWithNullDefault = null; public $propertyWithTrueDefault = true; } $class = new ReflectionClass('PhpClassWithPropertyDefaults'); var_dump($class->getProperty('propertyWithoutDefault')); var_dump($class->getProperty('propertyWithNullDefault')); var_dump($class->getProperty('propertyWithTrueDefault'));

preferences:
43.95 ms | 402 KiB | 5 Q