]> granicus.if.org Git - php/commitdiff
Remove call_user_method() and call_user_method_array() from master, long time depreca...
authorKalle Sommer Nielsen <kalle@php.net>
Sat, 5 Apr 2014 04:43:41 +0000 (06:43 +0200)
committerKalle Sommer Nielsen <kalle@php.net>
Sat, 5 Apr 2014 04:43:41 +0000 (06:43 +0200)
NEWS
UPGRADING
ext/standard/basic_functions.c
ext/standard/basic_functions.h
ext/standard/tests/general_functions/bug44487.phpt [deleted file]
ext/standard/tests/general_functions/call_user_method.phpt [deleted file]
ext/standard/tests/general_functions/call_user_method_002.phpt [deleted file]

diff --git a/NEWS b/NEWS
index 904168c747d424730d40a46c6ee116ac5a49641f..f5dbef1d7724c12a692f82ea0433216c4b7d1c82 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,9 @@ PHP                                                                        NEWS
 - DBA:
   . Fixed bug #62490 (dba_delete returns true on missing item (inifile)). (Mike)
 
+- Standard:
+  . Removed call_user_method() and call_user_method_array() functions. (Kalle)
+
 - XSL:
   . Fixed bug #64776 (The XSLT extension is not thread safe). (Mike)
 
index f5e36fefc8482bd346429ad6168316b6db94f13e..4c49485725a919bd244b0ded55bf2efb593b0f15 100755 (executable)
--- a/UPGRADING
+++ b/UPGRADING
@@ -78,3 +78,5 @@ PHP X.Y UPGRADE NOTES
 11. Other Changes
 ========================================
 
+- Standard
+  . call_user_method() and call_user_method_array() no longer exists.
index 14acccff96bd04f19d47daac6b485f38d26dc2b0..b524760072bd2b2e59cf8f0418e5dd38c5b46b1a 100644 (file)
@@ -702,18 +702,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_call_user_func_array, 0, 0, 2)
        ZEND_ARG_INFO(0, parameters) /* ARRAY_INFO(0, parameters, 1) */
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO_EX(arginfo_call_user_method, 0, 0, 2)
-       ZEND_ARG_INFO(0, method_name)
-       ZEND_ARG_INFO(1, object)
-       ZEND_ARG_VARIADIC_INFO(0, parameters)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_call_user_method_array, 0)
-       ZEND_ARG_INFO(0, method_name)
-       ZEND_ARG_INFO(1, object)
-       ZEND_ARG_INFO(0, params) /* ARRAY_INFO(0, params, 1) */
-ZEND_END_ARG_INFO()
-
 ZEND_BEGIN_ARG_INFO_EX(arginfo_forward_static_call, 0, 0, 1)
        ZEND_ARG_INFO(0, function_name)
        ZEND_ARG_VARIADIC_INFO(0, parameters)
@@ -2960,8 +2948,6 @@ const zend_function_entry basic_functions[] = { /* {{{ */
        PHP_FE(error_get_last,                                                                                                  arginfo_error_get_last)
        PHP_FE(call_user_func,                                                                                                  arginfo_call_user_func)
        PHP_FE(call_user_func_array,                                                                                    arginfo_call_user_func_array)
-       PHP_DEP_FE(call_user_method,                                                                                    arginfo_call_user_method)
-       PHP_DEP_FE(call_user_method_array,                                                                              arginfo_call_user_method_array)
        PHP_FE(forward_static_call,                                                                                     arginfo_forward_static_call)
        PHP_FE(forward_static_call_array,                                                                               arginfo_forward_static_call_array)
        PHP_FE(serialize,                                                                                                               arginfo_serialize)
@@ -4786,89 +4772,6 @@ PHP_FUNCTION(call_user_func_array)
 }
 /* }}} */
 
-/* {{{ proto mixed call_user_method(string method_name, mixed object [, mixed parameter] [, mixed ...])
-   Call a user method on a specific object or class */
-PHP_FUNCTION(call_user_method)
-{
-       zval ***params = NULL;
-       int n_params = 0;
-       zval *retval_ptr;
-       zval *callback, *object;
-
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/z*", &callback, &object, &params, &n_params) == FAILURE) {
-               return;
-       }
-
-       if (Z_TYPE_P(object) != IS_OBJECT &&
-               Z_TYPE_P(object) != IS_STRING
-       ) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument is not an object or class name");
-               if (params) {
-                       efree(params);
-               }
-               RETURN_FALSE;
-       }
-
-       convert_to_string(callback);
-
-       if (call_user_function_ex(EG(function_table), &object, callback, &retval_ptr, n_params, params, 0, NULL TSRMLS_CC) == SUCCESS) {
-               if (retval_ptr) {
-                       COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr);
-               }
-       } else {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s()", Z_STRVAL_P(callback));
-       }
-       if (n_params) {
-               efree(params);
-       }
-}
-/* }}} */
-
-/* {{{ proto mixed call_user_method_array(string method_name, mixed object, array params)
-   Call a user method on a specific object or class using a parameter array */
-PHP_FUNCTION(call_user_method_array)
-{
-       zval *params, ***method_args = NULL, *retval_ptr;
-       zval *callback, *object;
-       HashTable *params_ar;
-       int num_elems, element = 0;
-
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/zA/", &callback, &object, &params) == FAILURE) {
-               return;
-       }
-
-       if (Z_TYPE_P(object) != IS_OBJECT &&
-               Z_TYPE_P(object) != IS_STRING
-       ) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument is not an object or class name");
-               RETURN_FALSE;
-       }
-
-       convert_to_string(callback);
-
-       params_ar = HASH_OF(params);
-       num_elems = zend_hash_num_elements(params_ar);
-       method_args = (zval ***) safe_emalloc(sizeof(zval **), num_elems, 0);
-
-       for (zend_hash_internal_pointer_reset(params_ar);
-               zend_hash_get_current_data(params_ar, (void **) &(method_args[element])) == SUCCESS;
-               zend_hash_move_forward(params_ar)
-       ) {
-               element++;
-       }
-
-       if (call_user_function_ex(EG(function_table), &object, callback, &retval_ptr, num_elems, method_args, 0, NULL TSRMLS_CC) == SUCCESS) {
-               if (retval_ptr) {
-                       COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr);
-               }
-       } else {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s()", Z_STRVAL_P(callback));
-       }
-
-       efree(method_args);
-}
-/* }}} */
-
 /* {{{ proto mixed forward_static_call(mixed function_name [, mixed parmeter] [, mixed ...]) U
    Call a user function which is the first parameter */
 PHP_FUNCTION(forward_static_call)
index 3af85b3d403bbfed53e29b1b1dac7349aba386c5..3324427088b9f4329f5e1e22881c97d41cae0c06 100644 (file)
@@ -81,8 +81,6 @@ PHP_FUNCTION(error_get_last);
 
 PHP_FUNCTION(call_user_func);
 PHP_FUNCTION(call_user_func_array);
-PHP_FUNCTION(call_user_method);
-PHP_FUNCTION(call_user_method_array);
 PHP_FUNCTION(forward_static_call);
 PHP_FUNCTION(forward_static_call_array);
 
diff --git a/ext/standard/tests/general_functions/bug44487.phpt b/ext/standard/tests/general_functions/bug44487.phpt
deleted file mode 100644 (file)
index 10c52c6..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
---TEST--
-Bug #44487 (call_user_method_array issues a warning when throwing an exception)
---INI--
-error_reporting = E_ALL & ~E_DEPRECATED
---FILE--
-<?php
-
-class Foo
-{
-        public function test()
-        {
-                print 'test';
-                throw new Exception();
-        }
-}
-
-try {
-        $bar = new Foo();
-        call_user_method_array('test', $bar, array()) ;
-} catch (Exception $e) {
-}
-?>
---EXPECT--
-test
diff --git a/ext/standard/tests/general_functions/call_user_method.phpt b/ext/standard/tests/general_functions/call_user_method.phpt
deleted file mode 100644 (file)
index cc54ff9..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
---TEST--
-Basic behaviour of call_user_method() test
---CREDITS--
-Sebastian Schürmann 
-sebs@php.net
-Testfest 2009 Munich
---FILE--
-<?php
-class a {
-       static function b() {
-               return true;
-       }
-}
-$a = new a();
-$res = call_user_method('b', $a);
-var_dump($res);
-?>
---EXPECTF--
-Deprecated: Function call_user_method() is deprecated in %s on line 8
-bool(true)
diff --git a/ext/standard/tests/general_functions/call_user_method_002.phpt b/ext/standard/tests/general_functions/call_user_method_002.phpt
deleted file mode 100644 (file)
index 054bc3e..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
---TEST--
-call_user_method() Invalid free
---FILE--
-<?php
-
-call_user_method("1", $arr1);
-
-?>
---EXPECTF--
-Deprecated: Function call_user_method() is deprecated in %s on line %d
-
-Warning: call_user_method(): Second argument is not an object or class name in %s on line %d