cvs: ZendEngine2(PHP_5_3) / zend_API.c

From: Date: Tue, 25 Mar 2008 13:04:04 +0000
Subject: cvs: ZendEngine2(PHP_5_3) / zend_API.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-6580@lists.php.net to get a copy of this message
dmitry Tue Mar 25 13:04:04 2008 UTC Modified files: (Branch: PHP_5_3) /ZendEngine2 zend_API.c Log: Optimized detection of "__call" and "__callstatic" methods. http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.c?r1=1.296.2.27.2.34.2.32&r2=1.296.2.27.2.34.2.33&diff_format=u Index: ZendEngine2/zend_API.c diff -u ZendEngine2/zend_API.c:1.296.2.27.2.34.2.32 ZendEngine2/zend_API.c:1.296.2.27.2.34.2.33 --- ZendEngine2/zend_API.c:1.296.2.27.2.34.2.32 Tue Mar 18 14:10:43 2008 +++ ZendEngine2/zend_API.c Tue Mar 25 13:04:03 2008 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.c,v 1.296.2.27.2.34.2.32 2008/03/18 14:10:43 felipe Exp $ */ +/* $Id: zend_API.c,v 1.296.2.27.2.34.2.33 2008/03/25 13:04:03 dmitry Exp $ */ #include "zend.h" #include "zend_execute.h" @@ -2627,8 +2627,7 @@ ZEND_API int zend_fcall_info_init(zval *callable, uint check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, char **callable_name, char **error TSRMLS_DC) /* {{{ */ { - int lc_len; - char *lcname; + int len; zend_class_entry *ce; zend_function *func; zval **obj; @@ -2647,22 +2646,23 @@ fci->no_separation = 1; fci->symbol_table = NULL; - lc_len = strlen(func->common.function_name); - lcname = zend_str_tolower_dup(func->common.function_name, lc_len); - if ((lc_len == sizeof(ZEND_CALL_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME) - 1)) || - (lc_len == sizeof(ZEND_CALLSTATIC_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_CALLSTATIC_FUNC_NAME, sizeof(ZEND_CALLSTATIC_FUNC_NAME) - 1)) - ) { - fcc->initialized = 0; - fcc->function_handler = NULL; - fcc->calling_scope = NULL; - fcc->object_pp = NULL; - } else { - fcc->initialized = 1; - fcc->function_handler = func; - fcc->calling_scope = ce; - fcc->object_pp = obj; + if (ce) { + len = strlen(func->common.function_name); + if ((len == sizeof(ZEND_CALL_FUNC_NAME) - 1 && !zend_binary_strcasecmp(func->common.function_name, len, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME) - 1)) || + (len == sizeof(ZEND_CALLSTATIC_FUNC_NAME) - 1 && !zend_binary_strcasecmp(func->common.function_name, len, ZEND_CALLSTATIC_FUNC_NAME, sizeof(ZEND_CALLSTATIC_FUNC_NAME) - 1)) + ) { + fcc->initialized = 0; + fcc->function_handler = NULL; + fcc->calling_scope = NULL; + fcc->object_pp = NULL; + return SUCCESS; + } } - efree(lcname); + + fcc->initialized = 1; + fcc->function_handler = func; + fcc->calling_scope = ce; + fcc->object_pp = obj; return SUCCESS; }

« previous php.zend-engine.cvs (#6580) next »