diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index e13513e6603..bc8ffbdd8bd 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -942,6 +942,12 @@ static void _property_string(smart_str *str, zend_property_info *prop, const cha if (!prop) { smart_str_append_printf(str, " public $%s", prop_name); } else { + if (prop->flags & ZEND_ACC_ABSTRACT) { + smart_str_appends(str, "abstract "); + } + if (prop->flags & ZEND_ACC_FINAL) { + smart_str_appends(str, "final "); + } /* These are mutually exclusive */ switch (prop->flags & ZEND_ACC_PPP_MASK) { case ZEND_ACC_PUBLIC: diff --git a/ext/reflection/tests/abstract_property_indicated.phpt b/ext/reflection/tests/abstract_property_indicated.phpt new file mode 100644 index 00000000000..a70d88b7ece --- /dev/null +++ b/ext/reflection/tests/abstract_property_indicated.phpt @@ -0,0 +1,42 @@ +--TEST-- +Output of properties indicates if they are abstract +--FILE-- + +--EXPECTF-- +Class [ abstract class Demo ] { + @@ %s %d-%d + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [2] { + Property [ abstract public $a ] + Property [ public $b = NULL ] + } + + - Methods [0] { + } +} +Property [ abstract public $a ] +Property [ public $b = NULL ] diff --git a/ext/reflection/tests/asymmetric_visibility_flags.phpt b/ext/reflection/tests/asymmetric_visibility_flags.phpt index e6b171d3e76..580404decda 100644 --- a/ext/reflection/tests/asymmetric_visibility_flags.phpt +++ b/ext/reflection/tests/asymmetric_visibility_flags.phpt @@ -26,7 +26,7 @@ bool(true) bool(false) bool(true) bool(false) -Property [ public private(set) int $bar ] +Property [ final public private(set) int $bar ] bool(false) bool(true) bool(false) diff --git a/ext/reflection/tests/final_property_indicated.phpt b/ext/reflection/tests/final_property_indicated.phpt new file mode 100644 index 00000000000..d4e159749a9 --- /dev/null +++ b/ext/reflection/tests/final_property_indicated.phpt @@ -0,0 +1,42 @@ +--TEST-- +Output of properties indicates if they are final +--FILE-- + +--EXPECTF-- +Class [ class Demo ] { + @@ %s %d-%d + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [2] { + Property [ final public $a = NULL ] + Property [ public $b = NULL ] + } + + - Methods [0] { + } +} +Property [ final public $a = NULL ] +Property [ public $b = NULL ]