From: Andrei Zmievski Date: Mon, 5 Feb 2001 17:37:47 +0000 (+0000) Subject: Allow calling static methods via call_user_method_* functions. X-Git-Tag: php-4.0.5RC1~360 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5355703cf3b6cb8eac72751fb84a9eca48cfe6ef;p=php Allow calling static methods via call_user_method_* functions. --- 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);