mirror of
https://github.com/php/php-src.git
synced 2024-10-21 00:12:34 +00:00
29 lines
504 B
Plaintext
29 lines
504 B
Plaintext
|
--TEST--
|
||
|
ReflectionObject::hasProperty
|
||
|
--SKIPIF--
|
||
|
<?php extension_loaded('reflection') or die('skip'); ?>
|
||
|
--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)
|
||
|
string(2) "p4"
|
||
|
bool(false)
|