com php-src: Remove call_user_method() and call_u ser_method_array() from master, long time d eprecated in favour of call_user_func*().: NEWS
UPGRADING ext/standard/basic_functions.c ext/ standard/basic_functions.h ext/standard/tests/general_f unctions/bug44487.phpt
ext/standard/tests/general _functions/call_user_method.phpt ext/standard/tests/g eneral_functions/call_user_method_002.phpt
| From: | Kalle Sommer Nielsen | Date: | Sat, 05 Apr 2014 04:43:41 +0000 |
| Subject: | com php-src: Remove call_user_method() and call_u ser_method_array() from master, long time d eprecated in favour of call_user_func*().: NEWS UPGRADING ext/standard/basic_functions.c ext/ standard/basic_functions.h ext/standard/tests/general_f unctions/bug44487.phpt ext/standard/tests/general _functions/call_user_method.phpt ext/standard/tests/g eneral_functions/call_user_method_002.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-76703@lists.php.net to get a copy of this message | ||
Commit: 91aa9fbb473a51d62cd90faf5dda73245c9572ef
Author: Kalle Sommer Nielsen <kalle@php.net> Sat, 5 Apr 2014 06:43:41 +0200
Parents: 4d412421df6d4bce0be7f5530e97534a3d68a192
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=91aa9fbb473a51d62cd90faf5dda73245c9572ef
Log:
Remove call_user_method() and call_user_method_array() from master, long time deprecated in favour
of call_user_func*().
Changed paths:
M NEWS
M UPGRADING
M ext/standard/basic_functions.c
M ext/standard/basic_functions.h
D ext/standard/tests/general_functions/bug44487.phpt
D ext/standard/tests/general_functions/call_user_method.phpt
D ext/standard/tests/general_functions/call_user_method_002.phpt
Diff:
diff --git a/NEWS b/NEWS
index 904168c..f5dbef1 100644
--- 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)
diff --git a/UPGRADING b/UPGRADING
index f5e36fe..4c49485 100755
--- 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.
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 14acccf..b524760 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -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,
¶ms, &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, ¶ms) == 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)
diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h
index 3af85b3..3324427 100644
--- a/ext/standard/basic_functions.h
+++ b/ext/standard/basic_functions.h
@@ -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
index 10c52c6..0000000
--- a/ext/standard/tests/general_functions/bug44487.phpt
+++ /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
index cc54ff9..0000000
--- a/ext/standard/tests/general_functions/call_user_method.phpt
+++ /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
index 054bc3e..0000000
--- a/ext/standard/tests/general_functions/call_user_method_002.phpt
+++ /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