From 5355703cf3b6cb8eac72751fb84a9eca48cfe6ef Mon Sep 17 00:00:00 2001 From: Andrei Zmievski Date: Mon, 5 Feb 2001 17:37:47 +0000 Subject: [PATCH] Allow calling static methods via call_user_method_* functions. --- ext/standard/basic_functions.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 609f7f5697..8cdef464d5 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -1656,8 +1656,8 @@ PHP_FUNCTION(call_user_method) efree(params); RETURN_FALSE; } - if (Z_TYPE_PP(params[1]) != IS_OBJECT) { - php_error(E_WARNING,"2nd argument is not an object\n"); + if (Z_TYPE_PP(params[1]) != IS_OBJECT && Z_TYPE_PP(params[1]) != IS_STRING) { + php_error(E_WARNING,"2nd argument is not an object or class name\n"); efree(params); RETURN_FALSE; } @@ -1693,7 +1693,8 @@ PHP_FUNCTION(call_user_method_array) WRONG_PARAM_COUNT; } convert_to_string_ex(method_name); - convert_to_object_ex(obj); + if (Z_TYPE_PP(obj) != IS_OBJECT && Z_TYPE_PP(obj) != IS_STRING) + convert_to_object_ex(obj); convert_to_array_ex(params); params_ar = HASH_OF(*params); -- 2.50.1