diff options
author | Marcus Boerger <helly@php.net> | 2004-11-03 21:11:48 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2004-11-03 21:11:48 +0000 |
commit | 63b288c4646d405d0edfb7657505b2acf5643514 (patch) | |
tree | 14d26964b14dd6aef1a7b5fa8195023b459d6d05 /ext/reflection/php_reflection.c | |
parent | 2685ca935fceb0dbb4cb61161c93444cec7eef2c (diff) | |
download | php-git-63b288c4646d405d0edfb7657505b2acf5643514.tar.gz |
- Fix invokeargs() with static methods
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 992494cf89..8f03e8ef6a 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2029,7 +2029,7 @@ ZEND_METHOD(reflection_method, invokeArgs) GET_REFLECTION_OBJECT_PTR(mptr); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "oa", &object, ¶m_array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o!a", &object, ¶m_array) == FAILURE) { return; } @@ -2065,6 +2065,14 @@ ZEND_METHOD(reflection_method, invokeArgs) object = NULL; obj_ce = NULL; } else { + if (!object) { + efree(params); + zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, + "Trying to invoke non static method %s::%s without an object", + mptr->common.scope->name, mptr->common.function_name); + return; + } + obj_ce = Z_OBJCE_P(object); if (!instanceof_function(obj_ce, mptr->common.scope TSRMLS_CC)) { |