summaryrefslogtreecommitdiff
path: root/ext/reflection/tests/020.phpt
blob: fc2d0a61a0fb673171be36ae9473e5b5c937c78a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--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)
bool(false)