diff options
author | Xinchen Hui <laruence@php.net> | 2012-08-02 22:28:04 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2012-08-02 22:28:04 +0800 |
commit | 170ee90bf962d288bdcf6cf0c8c4a2a30c5c1ba2 (patch) | |
tree | ff5a7aaee629baca6110ca4dc02a876228333dc0 /ext/reflection/php_reflection.c | |
parent | 3b5defd3b09bf827239087126261ce9abdc13d09 (diff) | |
download | php-git-170ee90bf962d288bdcf6cf0c8c4a2a30c5c1ba2.tar.gz |
Fixed bug that can not get default value of parameter if it's not `optional`
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 7e80deaac6..6656f58c65 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1477,11 +1477,6 @@ static parameter_reference *_reflection_param_get_default_param(INTERNAL_FUNCTIO return NULL; } - if (param->offset < param->required) { - zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Parameter is not optional"); - return NULL; - } - return param; } /* }}} */ @@ -1497,7 +1492,7 @@ static zend_op *_reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAMETERS precv = _get_recv_op((zend_op_array*)param->fptr, param->offset); if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2_type == IS_UNUSED) { - zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Internal error"); + zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Internal error: Failed to retrieve the default value"); return NULL; } |