Re: cvs: php4 /ext/standard basic_functions.c

From: Date: Mon, 14 May 2001 19:08:30 +0000
Subject: Re: cvs: php4 /ext/standard basic_functions.c
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-5739@lists.php.net to get a copy of this message
On Mon, 14 May 2001, Sterling Hughes wrote: > +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)); > + } > + > + break; > + } > + } > +} Umm, just use zend_is_callable() and it'll give you back the formatted name of the function/method. > +#define _CUM_DEPREC "The %s() function is depreciated, use the call_user_func variety > with the array($obj, \"method\") syntax instead" It's "deprecated", by the way. -Andrei * E Pluribus UNIX. *

« previous php.cvs (#5739) next »