cvs: php4 /ext/standard basic_functions.c
| From: | Sterling Hughes | Date: | Mon, 14 May 2001 19:19:03 +0000 |
| Subject: | cvs: php4 /ext/standard basic_functions.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-5740@lists.php.net to get a copy of this message | ||
sterling Mon May 14 12:19:03 2001 EDT
Modified files:
/php4/ext/standard basic_functions.c
Log:
Use zend_is_callable() and fix sp of deprecated.
Index: php4/ext/standard/basic_functions.c
diff -u php4/ext/standard/basic_functions.c:1.334 php4/ext/standard/basic_functions.c:1.335
--- php4/ext/standard/basic_functions.c:1.334 Mon May 14 12:02:23 2001
+++ php4/ext/standard/basic_functions.c Mon May 14 12:19:03 2001
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.334 2001/05/14 19:02:23 sterling Exp $ */
+/* $Id: basic_functions.c,v 1.335 2001/05/14 19:19:03 sterling Exp $ */
#include "php.h"
#include "php_main.h"
@@ -1605,30 +1605,11 @@
static void unable_to_call_user_function(zval **fcall)
{
- switch (Z_TYPE_PP(fcall)) {
- case IS_STRING:
- php_error(E_WARNING, "Unable to call %s()", Z_STRVAL_PP(fcall));
- break;
- case IS_ARRAY: {
- zval **tmp_obj;
- zval **tmp_func;
- char format[] = "Unable to call %s::%s()";
-
- zend_hash_index_find(Z_ARRVAL_PP(fcall), 0, (void **) &tmp_obj);
- zend_hash_index_find(Z_ARRVAL_PP(fcall), 1, (void **) &tmp_func);
-
- if (Z_TYPE_PP(tmp_obj) == IS_OBJECT) {
- php_error(E_WARNING, format, Z_OBJCE_PP(tmp_obj)->name, Z_STRVAL_PP(tmp_func));
- }
- else {
- convert_to_string_ex(tmp_obj);
-
- php_error(E_WARNING, format, Z_STRVAL_PP(tmp_obj), Z_STRVAL_PP(tmp_func));
- }
+ char *name;
- break;
- }
- }
+ zend_is_callable(*fcall, 1, &name);
+ php_error(E_WARNING, "Unable to call %s()", name);
+ efree(name);
}
/* {{{ proto mixed call_user_func(string function_name [, mixed parmeter] [, mixed ...])
@@ -1709,7 +1690,7 @@
}
/* }}} */
-#define _CUM_DEPREC "The %s() function is depreciated, use the call_user_func variety with the
array($obj, \"method\") syntax instead"
+#define _CUM_DEPREC "The %s() function is deprecated, use the call_user_func variety with the
array(&$obj, \"method\") syntax instead"
/* {{{ proto mixed call_user_method(string method_name, mixed object [, mixed parameter] [, mixed
...])
Call a user method on a specific object or class */