From 0d330e1a022d536de8a679d11dc8ec6f9fd64be3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Tue, 28 Jul 2020 23:00:44 +0200 Subject: Add a few missing parameter types in stubs Related to GH-5627 --- ext/reflection/php_reflection.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'ext/reflection/php_reflection.c') diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 5172b928e3..1d6d6b7a8d 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -3089,16 +3089,20 @@ ZEND_METHOD(ReflectionMethod, __toString) ZEND_METHOD(ReflectionMethod, getClosure) { reflection_object *intern; - zval *obj; + zval *obj = NULL; zend_function *mptr; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|o!", &obj) == FAILURE) { + RETURN_THROWS(); + } + GET_REFLECTION_OBJECT_PTR(mptr); if (mptr->common.fn_flags & ZEND_ACC_STATIC) { zend_create_fake_closure(return_value, mptr, mptr->common.scope, mptr->common.scope, NULL); } else { - if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) { - RETURN_THROWS(); + if (!obj) { + zend_argument_value_error(1, "cannot be null for non-static methods"); } if (!instanceof_function(Z_OBJCE_P(obj), mptr->common.scope)) { -- cgit v1.2.1