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