helly           Sat Feb  2 13:58:31 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/standard       type.c 
  Log:
  - MFH Use new parameter parsing API
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/type.c?r1=1.30.2.2.2.3.2.3&r2=1.30.2.2.2.3.2.4&diff_format=u
Index: php-src/ext/standard/type.c
diff -u php-src/ext/standard/type.c:1.30.2.2.2.3.2.3 
php-src/ext/standard/type.c:1.30.2.2.2.3.2.4
--- php-src/ext/standard/type.c:1.30.2.2.2.3.2.3        Fri Feb  1 21:27:55 2008
+++ php-src/ext/standard/type.c Sat Feb  2 13:58:31 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: type.c,v 1.30.2.2.2.3.2.3 2008/02/01 21:27:55 helly Exp $ */
+/* $Id: type.c,v 1.30.2.2.2.3.2.4 2008/02/02 13:58:31 helly Exp $ */
 
 #include "php.h"
 #include "php_incomplete_class.h"
@@ -359,28 +359,22 @@
    Returns true if var is callable. */
 PHP_FUNCTION(is_callable)
 {
-       zval **var, **syntax_only, **callable_name;
-       char *name;
+       zval *var, **callable_name;
+       zval name;
        zend_bool retval;
-       zend_bool syntax = 0;
-       int argc=ZEND_NUM_ARGS();
+       zend_bool syntax_only = 0;
 
-       if (argc < 1 || argc > 3 || zend_get_parameters_ex(argc, &var, 
&syntax_only, &callable_name) == FAILURE) {
-               WRONG_PARAM_COUNT;
-       }
-
-       if (argc > 1) {
-               convert_to_boolean_ex(syntax_only);
-               syntax = Z_BVAL_PP(syntax_only);
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|bZ", &var,
+                                                         &syntax_only, 
&callable_name) == FAILURE) {
+               return;
        }
 
-       syntax = syntax ? IS_CALLABLE_CHECK_SYNTAX_ONLY : 0;
-       if (argc > 2) {
-               retval = zend_is_callable(*var, syntax, &name);
-               zval_dtor(*callable_name);
-               ZVAL_STRING(*callable_name, name, 0);
+       syntax_only = syntax_only ? IS_CALLABLE_CHECK_SYNTAX_ONLY : 0;
+       if (ZEND_NUM_ARGS() > 2) {
+               retval = zend_is_callable(var, syntax_only, &name);
+               REPLACE_ZVAL_VALUE(callable_name, &name, 0);
        } else {
-               retval = zend_is_callable(*var, syntax, NULL);
+               retval = zend_is_callable(var, syntax_only, NULL);
        }
 
        RETURN_BOOL(retval);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to