mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix bug #81474: Make ReflectionAttribute non-final
This backports GH-7520 to PHP 8.0. Closes GH-7545.
This commit is contained in:
parent
57a32c6a69
commit
e286313fa7
5 changed files with 5 additions and 13 deletions
3
NEWS
3
NEWS
|
@ -29,6 +29,9 @@ PHP NEWS
|
||||||
- PCRE:
|
- PCRE:
|
||||||
. Fixed bug #81424 (PCRE2 10.35 JIT performance regression). (cmb)
|
. Fixed bug #81424 (PCRE2 10.35 JIT performance regression). (cmb)
|
||||||
|
|
||||||
|
- Reflection:
|
||||||
|
. ReflectionAttribute is no longer final. (sasezaki)
|
||||||
|
|
||||||
- SPL:
|
- SPL:
|
||||||
. Fixed bug #80663 (Recursive SplFixedArray::setSize() may cause double-free).
|
. Fixed bug #80663 (Recursive SplFixedArray::setSize() may cause double-free).
|
||||||
(cmb, Nikita, Tyson Andre)
|
(cmb, Nikita, Tyson Andre)
|
||||||
|
|
|
@ -6618,7 +6618,6 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
|
||||||
|
|
||||||
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionAttribute", class_ReflectionAttribute_methods);
|
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionAttribute", class_ReflectionAttribute_methods);
|
||||||
reflection_init_class_handlers(&_reflection_entry);
|
reflection_init_class_handlers(&_reflection_entry);
|
||||||
_reflection_entry.ce_flags |= ZEND_ACC_FINAL;
|
|
||||||
reflection_attribute_ptr = zend_register_internal_class(&_reflection_entry);
|
reflection_attribute_ptr = zend_register_internal_class(&_reflection_entry);
|
||||||
|
|
||||||
REGISTER_REFLECTION_CLASS_CONST_LONG(attribute, "IS_INSTANCEOF", REFLECTION_ATTRIBUTE_IS_INSTANCEOF);
|
REGISTER_REFLECTION_CLASS_CONST_LONG(attribute, "IS_INSTANCEOF", REFLECTION_ATTRIBUTE_IS_INSTANCEOF);
|
||||||
|
|
|
@ -653,7 +653,7 @@ final class ReflectionReference
|
||||||
private function __construct() {}
|
private function __construct() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
final class ReflectionAttribute
|
class ReflectionAttribute
|
||||||
{
|
{
|
||||||
public function getName(): string {}
|
public function getName(): string {}
|
||||||
public function getTarget(): int {}
|
public function getTarget(): int {}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* This is a generated file, edit the .stub.php file instead.
|
/* This is a generated file, edit the .stub.php file instead.
|
||||||
* Stub hash: 6849bff1f2b343df4bd7e6da9c8adc555731e2d3 */
|
* Stub hash: 6e98777552147f4a413db16ecd87c9a6931f9c00 */
|
||||||
|
|
||||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Reflection_getModifierNames, 0, 0, 1)
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Reflection_getModifierNames, 0, 0, 1)
|
||||||
ZEND_ARG_TYPE_INFO(0, modifiers, IS_LONG, 0)
|
ZEND_ARG_TYPE_INFO(0, modifiers, IS_LONG, 0)
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
--TEST--
|
|
||||||
Check that ReflectionAttribute is final
|
|
||||||
--FILE--
|
|
||||||
<?php
|
|
||||||
|
|
||||||
class T extends ReflectionAttribute {}
|
|
||||||
|
|
||||||
?>
|
|
||||||
--EXPECTF--
|
|
||||||
Fatal error: Class T may not inherit from final class (ReflectionAttribute) in %s on line %d
|
|
Loading…
Add table
Add a link
Reference in a new issue