mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Initialize attributes for internal functions
Fixes a crash in Symfony SecurityBundle tests.
This commit is contained in:
parent
48e9181519
commit
2bf2cede89
2 changed files with 33 additions and 0 deletions
32
Zend/tests/attributes/029_reflect_internal_symbols.phpt
Normal file
32
Zend/tests/attributes/029_reflect_internal_symbols.phpt
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
--TEST--
|
||||||
|
Reflect attributes on different kinds of internal symbols
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$rf = new ReflectionFunction('unserialize');
|
||||||
|
var_dump($rf->getAttributes());
|
||||||
|
|
||||||
|
$rc = new ReflectionClass('DateTime');
|
||||||
|
var_dump($rc->getAttributes());
|
||||||
|
|
||||||
|
$rm = $rc->getMethod('__construct');
|
||||||
|
var_dump($rm->getAttributes());
|
||||||
|
|
||||||
|
$rcc = $rc->getReflectionConstant('ATOM');
|
||||||
|
var_dump($rcc->getAttributes());
|
||||||
|
|
||||||
|
$rp = new ReflectionProperty('Exception', 'message');
|
||||||
|
var_dump($rp->getAttributes());
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
array(0) {
|
||||||
|
}
|
||||||
|
array(0) {
|
||||||
|
}
|
||||||
|
array(0) {
|
||||||
|
}
|
||||||
|
array(0) {
|
||||||
|
}
|
||||||
|
array(0) {
|
||||||
|
}
|
|
@ -2325,6 +2325,7 @@ ZEND_API zend_result zend_register_functions(zend_class_entry *scope, const zend
|
||||||
internal_function->function_name = zend_string_init_interned(ptr->fname, fname_len, 1);
|
internal_function->function_name = zend_string_init_interned(ptr->fname, fname_len, 1);
|
||||||
internal_function->scope = scope;
|
internal_function->scope = scope;
|
||||||
internal_function->prototype = NULL;
|
internal_function->prototype = NULL;
|
||||||
|
internal_function->attributes = NULL;
|
||||||
if (ptr->flags) {
|
if (ptr->flags) {
|
||||||
if (!(ptr->flags & ZEND_ACC_PPP_MASK)) {
|
if (!(ptr->flags & ZEND_ACC_PPP_MASK)) {
|
||||||
if (ptr->flags != ZEND_ACC_DEPRECATED && scope) {
|
if (ptr->flags != ZEND_ACC_DEPRECATED && scope) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue