1--TEST-- 2ReflectionParameter::isDefault() 3--FILE-- 4<?php 5#[AllowDynamicProperties] 6class A { 7public $defprop; 8} 9$a = new A; 10$a->myprop = null; 11 12$ro = new ReflectionObject($a); 13$props = $ro->getProperties(); 14$prop1 = $props[0]; 15var_dump($prop1->isDefault()); 16$prop2 = $props[1]; 17var_dump($prop2->isDefault()); 18 19var_dump($ro->getProperty('defprop')->isDefault()); 20var_dump($ro->getProperty('myprop')->isDefault()); 21 22$prop1 = new ReflectionProperty($a, 'defprop'); 23$prop2 = new ReflectionProperty($a, 'myprop'); 24var_dump($prop1->isDefault()); 25var_dump($prop2->isDefault()); 26?> 27--EXPECT-- 28bool(true) 29bool(false) 30bool(true) 31bool(false) 32bool(true) 33bool(false) 34