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