Skip to content

Commit 6f0541c

Browse files
DanielEScherzercharmitro
authored andcommitted
Reflection: show the type of object constants used as default properties
When a property default is based on a global constant, show the type of the default. Previously, `format_default_value()` assumed that non-scalar and non-array defaults were always going to be `IS_CONSTANT_AST` pointers, and when the AST expression had been evaluated and produced an object, depending on when the `ReflectionClass` or `ReflectionProperty` instance had been created, the default was shown as one of `callable` or `__CLASS__`. Instead, if the default value is an object (`IS_OBJECT`), show the type of that object. Add test cases for both of the `callable` and `__CLASS__` cases to confirm that they now properly show the type of the constant. Closes phpGH-15902. Closes phpGH-17781.
1 parent 1bb8875 commit 6f0541c

File tree

6 files changed

+358
-937
lines changed

6 files changed

+358
-937
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ PHP NEWS
5151
. Partially fixed bug GH-17387 (Trivial crash in phpdbg lexer). (nielsdos)
5252
. Fix memory leak in phpdbg calling registered function. (nielsdos)
5353

54+
- Reflection:
55+
. Fixed bug GH-15902 (Core dumped in ext/reflection/php_reflection.c).
56+
(DanielEScherzer)
57+
5458
- Streams:
5559
. Fixed bug GH-17650 (realloc with size 0 in user_filters.c). (nielsdos)
5660
. Fix memory leak on overflow in _php_stream_scandir(). (nielsdos)

0 commit comments

Comments
 (0)