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
27echo "Wrong number of params:\n";
28$propInfo = new ReflectionProperty('TestClass', 'pub');
29$propInfo->isDefault(1);
30
31?>
32--EXPECTF--
33**********************************
34Reflecting on property TestClass::pub
35
36isDefault():
37bool(true)
38
39**********************************
40**********************************
41Reflecting on property TestClass::stat
42
43isDefault():
44bool(true)
45
46**********************************
47**********************************
48Reflecting on property TestClass::prot
49
50isDefault():
51bool(true)
52
53**********************************
54**********************************
55Reflecting on property TestClass::priv
56
57isDefault():
58bool(true)
59
60**********************************
61Wrong number of params:
62
63Warning: ReflectionProperty::isDefault() expects exactly 0 parameters, 1 given in %s on line %d
64