xref: /php-src/ext/reflection/tests/024.phpt (revision 902d6439)
1--TEST--
2ReflectionObject::__toString (filtering privates/protected dynamic properties)
3--FILE--
4<?php
5#[AllowDynamicProperties]
6class C1 {
7    private   $p1 = 1;
8    protected $p2 = 2;
9    public    $p3 = 3;
10}
11
12$x = new C1();
13$x->z = 4;
14$x->p3 = 5;
15
16$obj = new ReflectionObject($x);
17echo $obj;
18?>
19--EXPECTF--
20Object of class [ <user> class C1 ] {
21  @@ %s
22
23  - Constants [0] {
24  }
25
26  - Static properties [0] {
27  }
28
29  - Static methods [0] {
30  }
31
32  - Properties [3] {
33    Property [ private $p1 = 1 ]
34    Property [ protected $p2 = 2 ]
35    Property [ public $p3 = 3 ]
36  }
37
38  - Dynamic properties [1] {
39    Property [ <dynamic> public $z ]
40  }
41
42  - Methods [0] {
43  }
44}
45