-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* PHP-8.3: Reflection: show the type of object constants used as default properties
- Loading branch information
Showing
6 changed files
with
129 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
ext/reflection/tests/gh15902/ReflectionClass-callable.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--TEST-- | ||
ReflectionClass object default property - used to say "callable" | ||
--INI-- | ||
opcache.enable_cli=0 | ||
--FILE-- | ||
<?php | ||
|
||
class C { | ||
public stdClass $a = FOO; | ||
} | ||
define('FOO', new stdClass); | ||
|
||
new C; | ||
|
||
$reflector = new ReflectionClass(C::class); | ||
echo $reflector; | ||
?> | ||
--EXPECTF-- | ||
Class [ <user> class C ] { | ||
@@ %sReflectionClass-callable.php %d-%d | ||
|
||
- Constants [0] { | ||
} | ||
|
||
- Static properties [0] { | ||
} | ||
|
||
- Static methods [0] { | ||
} | ||
|
||
- Properties [1] { | ||
Property [ public stdClass $a = object(stdClass) ] | ||
} | ||
|
||
- Methods [0] { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--TEST-- | ||
ReflectionClass object default property - used to say "__CLASS__" | ||
--INI-- | ||
opcache.enable_cli=0 | ||
--FILE-- | ||
<?php | ||
|
||
class C { | ||
public stdClass $a = FOO; | ||
} | ||
$reflector = new ReflectionClass(C::class); | ||
|
||
define('FOO', new stdClass); | ||
new C; | ||
|
||
echo $reflector; | ||
|
||
?> | ||
--EXPECTF-- | ||
Class [ <user> class C ] { | ||
@@ %sReflectionClass-class.php %d-%d | ||
|
||
- Constants [0] { | ||
} | ||
|
||
- Static properties [0] { | ||
} | ||
|
||
- Static methods [0] { | ||
} | ||
|
||
- Properties [1] { | ||
Property [ public stdClass $a = object(stdClass) ] | ||
} | ||
|
||
- Methods [0] { | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
ext/reflection/tests/gh15902/ReflectionProperty-callable.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--TEST-- | ||
ReflectionProperty object default - used to say "callable" | ||
--INI-- | ||
opcache.enable_cli=0 | ||
--FILE-- | ||
<?php | ||
|
||
class C { | ||
public stdClass $a = FOO; | ||
} | ||
define('FOO', new stdClass); | ||
|
||
new C; | ||
|
||
$reflector = new ReflectionProperty(C::class, 'a'); | ||
echo $reflector; | ||
|
||
?> | ||
--EXPECTF-- | ||
Property [ public stdClass $a = object(stdClass) ] |
20 changes: 20 additions & 0 deletions
20
ext/reflection/tests/gh15902/ReflectionProperty-class.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--TEST-- | ||
ReflectionProperty object default - used to say "__CLASS__" | ||
--INI-- | ||
opcache.enable_cli=0 | ||
--FILE-- | ||
<?php | ||
|
||
class C { | ||
public stdClass $a = FOO; | ||
} | ||
$reflector = new ReflectionProperty(C::class, 'a'); | ||
|
||
define('FOO', new stdClass); | ||
new C; | ||
|
||
echo $reflector; | ||
|
||
?> | ||
--EXPECTF-- | ||
Property [ public stdClass $a = object(stdClass) ] |