2006-10-17 11:11:45 +00:00
|
|
|
--TEST--
|
|
|
|
ReflectionObject::hasProperty
|
2007-04-12 12:43:54 +00:00
|
|
|
--SKIPIF--
|
|
|
|
<?php extension_loaded('reflection') or die('skip'); ?>
|
2006-10-17 11:11:45 +00:00
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
class Foo {
|
|
|
|
public $p1;
|
|
|
|
protected $p2;
|
|
|
|
private $p3;
|
|
|
|
|
|
|
|
function __isset($name) {
|
|
|
|
var_dump($name);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$obj = new ReflectionObject(new Foo());
|
|
|
|
var_dump($obj->hasProperty("p1"));
|
|
|
|
var_dump($obj->hasProperty("p2"));
|
|
|
|
var_dump($obj->hasProperty("p3"));
|
|
|
|
var_dump($obj->hasProperty("p4"));
|
|
|
|
?>
|
|
|
|
--EXPECT--
|
|
|
|
bool(true)
|
|
|
|
bool(true)
|
|
|
|
bool(true)
|
|
|
|
unicode(2) "p4"
|
|
|
|
bool(false)
|