1--TEST-- 2Test ReflectionProperty::isDefault() usage. 3--FILE-- 4<?php 5 6function reflectProperty($class, $property) { 7 $propInfo = new ReflectionProperty($class, $property); 8 echo "**********************************\n"; 9 echo "Reflecting on property $class::$property\n\n"; 10 echo "isDefault():\n"; 11 var_dump($propInfo->isDefault()); 12 echo "\n**********************************\n"; 13} 14 15class TestClass { 16 public $pub; 17 static public $stat = "static property"; 18 protected $prot = 4; 19 private $priv = "keepOut"; 20} 21 22reflectProperty("TestClass", "pub"); 23reflectProperty("TestClass", "stat"); 24reflectProperty("TestClass", "prot"); 25reflectProperty("TestClass", "priv"); 26 27?> 28--EXPECT-- 29********************************** 30Reflecting on property TestClass::pub 31 32isDefault(): 33bool(true) 34 35********************************** 36********************************** 37Reflecting on property TestClass::stat 38 39isDefault(): 40bool(true) 41 42********************************** 43********************************** 44Reflecting on property TestClass::prot 45 46isDefault(): 47bool(true) 48 49********************************** 50********************************** 51Reflecting on property TestClass::priv 52 53isDefault(): 54bool(true) 55 56********************************** 57