]> granicus.if.org Git - php/commitdiff
Allow calling static methods via call_user_method_* functions.
authorAndrei Zmievski <andrei@php.net>
Mon, 5 Feb 2001 17:37:47 +0000 (17:37 +0000)
committerAndrei Zmievski <andrei@php.net>
Mon, 5 Feb 2001 17:37:47 +0000 (17:37 +0000)
ext/standard/basic_functions.c

index 609f7f5697ce0993023e6d9891b5c13111b43511..8cdef464d5147366f49b2b1c7e017f229e6ab1d3 100644 (file)
@@ -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);