mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Always use IS_CONSTANT_AST (IS_CONSTANT is removed).
This commit is contained in:
parent
08c0998b1f
commit
ef5ea48741
31 changed files with 229 additions and 235 deletions
|
@ -2806,7 +2806,7 @@ ZEND_METHOD(reflection_parameter, getDefaultValue)
|
|||
}
|
||||
|
||||
ZVAL_DUP(return_value, RT_CONSTANT(precv, precv->op2));
|
||||
if (Z_CONSTANT_P(return_value)) {
|
||||
if (Z_TYPE_P(return_value) == IS_CONSTANT_AST) {
|
||||
zval_update_constant_ex(return_value, param->fptr->common.scope);
|
||||
}
|
||||
}
|
||||
|
@ -2829,8 +2829,13 @@ ZEND_METHOD(reflection_parameter, isDefaultValueConstant)
|
|||
}
|
||||
|
||||
precv = _reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAM_PASSTHRU, param);
|
||||
if (precv && Z_TYPE_P(RT_CONSTANT(precv, precv->op2)) == IS_CONSTANT) {
|
||||
RETURN_TRUE;
|
||||
if (precv && Z_TYPE_P(RT_CONSTANT(precv, precv->op2)) == IS_CONSTANT_AST) {
|
||||
zend_ast *ast = Z_ASTVAL_P(RT_CONSTANT(precv, precv->op2));
|
||||
|
||||
if (ast->kind == ZEND_AST_CONSTANT
|
||||
|| ast->kind == ZEND_AST_CONSTANT_CLASS) {
|
||||
RETURN_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_FALSE;
|
||||
|
@ -2854,8 +2859,14 @@ ZEND_METHOD(reflection_parameter, getDefaultValueConstantName)
|
|||
}
|
||||
|
||||
precv = _reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAM_PASSTHRU, param);
|
||||
if (precv && Z_TYPE_P(RT_CONSTANT(precv, precv->op2)) == IS_CONSTANT) {
|
||||
RETURN_STR_COPY(Z_STR_P(RT_CONSTANT(precv, precv->op2)));
|
||||
if (precv && Z_TYPE_P(RT_CONSTANT(precv, precv->op2)) == IS_CONSTANT_AST) {
|
||||
zend_ast *ast = Z_ASTVAL_P(RT_CONSTANT(precv, precv->op2));
|
||||
|
||||
if (ast->kind == ZEND_AST_CONSTANT) {
|
||||
RETURN_STR_COPY(zend_ast_get_constant_name(ast));
|
||||
} else if (ast->kind == ZEND_AST_CONSTANT_CLASS) {
|
||||
RETURN_STRINGL("__CLASS__", sizeof("__CLASS__")-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
@ -3698,7 +3709,7 @@ ZEND_METHOD(reflection_class_constant, getValue)
|
|||
GET_REFLECTION_OBJECT_PTR(ref);
|
||||
|
||||
ZVAL_DUP(return_value, &ref->value);
|
||||
if (Z_CONSTANT_P(return_value)) {
|
||||
if (Z_TYPE_P(return_value) == IS_CONSTANT_AST) {
|
||||
zval_update_constant_ex(return_value, ref->ce);
|
||||
}
|
||||
}
|
||||
|
@ -3834,7 +3845,7 @@ static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value
|
|||
|
||||
/* this is necessary to make it able to work with default array
|
||||
* properties, returned to user */
|
||||
if (Z_CONSTANT(prop_copy)) {
|
||||
if (Z_TYPE(prop_copy) == IS_CONSTANT_AST) {
|
||||
if (UNEXPECTED(zval_update_constant_ex(&prop_copy, NULL) != SUCCESS)) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue