1--TEST-- 2ReflectionClass::hasProperty() 3--CREDITS-- 4Marc Veldman <marc@ibuildings.nl> 5#testfest roosendaal on 2008-05-10 6--FILE-- 7<?php 8//New instance of class C - defined below 9$rc = new ReflectionClass("C"); 10 11//Check if C has public property publicFoo 12var_dump($rc->hasProperty('publicFoo')); 13 14//Check if C has protected property protectedFoo 15var_dump($rc->hasProperty('protectedFoo')); 16 17//Check if C has private property privateFoo 18var_dump($rc->hasProperty('privateFoo')); 19 20//Check if C has static property staticFoo 21var_dump($rc->hasProperty('staticFoo')); 22 23//C should not have property bar 24var_dump($rc->hasProperty('bar')); 25 26Class C { 27 public $publicFoo; 28 protected $protectedFoo; 29 private $privateFoo; 30 public static $staticFoo; 31} 32?> 33--EXPECTF-- 34bool(true) 35bool(true) 36bool(true) 37bool(true) 38bool(false) 39