mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fixed bug #78895 (Reflection detects abstract non-static class as abstract static. IS_IMPLICIT_ABSTRACT is not longer used)
This commit is contained in:
parent
b37a5b9ca4
commit
42a2fb8411
3 changed files with 44 additions and 1 deletions
4
NEWS
4
NEWS
|
@ -37,6 +37,10 @@ PHP NEWS
|
||||||
- PCRE:
|
- PCRE:
|
||||||
. Fixed bug #78853 (preg_match() may return integer > 1). (cmb)
|
. Fixed bug #78853 (preg_match() may return integer > 1). (cmb)
|
||||||
|
|
||||||
|
- Reflection:
|
||||||
|
. Fixed bug #78895 (Reflection detects abstract non-static class as abstract
|
||||||
|
static. IS_IMPLICIT_ABSTRACT is not longer used). (Dmitry)
|
||||||
|
|
||||||
- Standard:
|
- Standard:
|
||||||
. Fixed bug #77638 (var_export'ing certain class instances segfaults). (cmb)
|
. Fixed bug #77638 (var_export'ing certain class instances segfaults). (cmb)
|
||||||
. Fixed bug #78840 (imploding $GLOBALS crashes). (cmb)
|
. Fixed bug #78840 (imploding $GLOBALS crashes). (cmb)
|
||||||
|
|
|
@ -4574,7 +4574,7 @@ ZEND_METHOD(reflection_class, getModifiers)
|
||||||
reflection_object *intern;
|
reflection_object *intern;
|
||||||
zend_class_entry *ce;
|
zend_class_entry *ce;
|
||||||
uint32_t keep_flags = ZEND_ACC_FINAL
|
uint32_t keep_flags = ZEND_ACC_FINAL
|
||||||
| ZEND_ACC_EXPLICIT_ABSTRACT_CLASS | ZEND_ACC_IMPLICIT_ABSTRACT_CLASS;
|
| ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
|
||||||
|
|
||||||
if (zend_parse_parameters_none() == FAILURE) {
|
if (zend_parse_parameters_none() == FAILURE) {
|
||||||
return;
|
return;
|
||||||
|
@ -6835,6 +6835,7 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
|
||||||
zend_class_implements(reflection_class_ptr, 1, reflector_ptr);
|
zend_class_implements(reflection_class_ptr, 1, reflector_ptr);
|
||||||
zend_declare_property_string(reflection_class_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
|
zend_declare_property_string(reflection_class_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
|
||||||
|
|
||||||
|
/* IS_IMPLICIT_ABSTRACT is not longer used */
|
||||||
REGISTER_REFLECTION_CLASS_CONST_LONG(class, "IS_IMPLICIT_ABSTRACT", ZEND_ACC_IMPLICIT_ABSTRACT_CLASS);
|
REGISTER_REFLECTION_CLASS_CONST_LONG(class, "IS_IMPLICIT_ABSTRACT", ZEND_ACC_IMPLICIT_ABSTRACT_CLASS);
|
||||||
REGISTER_REFLECTION_CLASS_CONST_LONG(class, "IS_EXPLICIT_ABSTRACT", ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
|
REGISTER_REFLECTION_CLASS_CONST_LONG(class, "IS_EXPLICIT_ABSTRACT", ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
|
||||||
REGISTER_REFLECTION_CLASS_CONST_LONG(class, "IS_FINAL", ZEND_ACC_FINAL);
|
REGISTER_REFLECTION_CLASS_CONST_LONG(class, "IS_FINAL", ZEND_ACC_FINAL);
|
||||||
|
|
38
ext/reflection/tests/bug78895.phpt
Normal file
38
ext/reflection/tests/bug78895.phpt
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
--TEST--
|
||||||
|
Fixed bug #78895 (Reflection detects abstract non-static class as abstract static).
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
abstract class Foo {
|
||||||
|
abstract public function f1();
|
||||||
|
}
|
||||||
|
interface I {
|
||||||
|
public function f2();
|
||||||
|
}
|
||||||
|
trait T {
|
||||||
|
abstract public function f2();
|
||||||
|
}
|
||||||
|
class Bar extends Foo implements I {
|
||||||
|
use T;
|
||||||
|
function f1() {}
|
||||||
|
function f2() {}
|
||||||
|
}
|
||||||
|
$ref = new ReflectionClass(Foo::class);
|
||||||
|
var_dump(Reflection::getModifierNames($ref->getModifiers()));
|
||||||
|
$ref = new ReflectionClass(I::class);
|
||||||
|
var_dump(Reflection::getModifierNames($ref->getModifiers()));
|
||||||
|
$ref = new ReflectionClass(T::class);
|
||||||
|
var_dump(Reflection::getModifierNames($ref->getModifiers()));
|
||||||
|
$ref = new ReflectionClass(Bar::class);
|
||||||
|
var_dump(Reflection::getModifierNames($ref->getModifiers()));
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
array(1) {
|
||||||
|
[0]=>
|
||||||
|
string(8) "abstract"
|
||||||
|
}
|
||||||
|
array(0) {
|
||||||
|
}
|
||||||
|
array(0) {
|
||||||
|
}
|
||||||
|
array(0) {
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue