File tree Expand file tree Collapse file tree 2 files changed +61
-0
lines changed
ext/reflection/tests/gh15902 Expand file tree Collapse file tree 2 files changed +61
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ ReflectionClass object default property - used to say "..."
3
+ --FILE--
4
+ <?php
5
+
6
+ class C {
7
+ public stdClass $ a = FOO ;
8
+ }
9
+ $ reflector = new ReflectionClass (C::class);
10
+ $ c = $ reflector ->newLazyGhost (function () {});
11
+
12
+ define ('FOO ' , new stdClass );
13
+
14
+ $ c ->a ;
15
+
16
+ var_dump ( (string )$ reflector );
17
+
18
+ ?>
19
+ --EXPECTF--
20
+ string(%d) "Class [ <user> class C ] {
21
+ @@ %sReflectionClass-dots.php %d-%d
22
+
23
+ - Constants [0] {
24
+ }
25
+
26
+ - Static properties [0] {
27
+ }
28
+
29
+ - Static methods [0] {
30
+ }
31
+
32
+ - Properties [1] {
33
+ Property [ public stdClass $a = object(stdClass) ]
34
+ }
35
+
36
+ - Methods [0] {
37
+ }
38
+ }
39
+ "
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ ReflectionProperty object default - used to say "..."
3
+ --FILE--
4
+ <?php
5
+
6
+ class C {
7
+ public stdClass $ a = FOO ;
8
+ }
9
+ $ reflector = new ReflectionProperty (C::class, 'a ' );
10
+ $ lazyFactory = new ReflectionClass (C::class);
11
+ $ c = $ lazyFactory ->newLazyGhost (function () {});
12
+
13
+ define ('FOO ' , new stdClass );
14
+
15
+ $ c ->a ;
16
+
17
+ var_dump ( (string )$ reflector );
18
+
19
+ ?>
20
+ --EXPECTF--
21
+ string(%d) "Property [ public stdClass $a = object(stdClass) ]
22
+ "
You can’t perform that action at this time.
0 commit comments