summaryrefslogtreecommitdiff
path: root/ext/spl/php_spl.c
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2005-12-21 20:12:44 +0000
committerMarcus Boerger <helly@php.net>2005-12-21 20:12:44 +0000
commitd3ae24eb79c46583c335013002615dca174df6b7 (patch)
tree4bda9d865cd8b68ca9d1afd4d9d5e9d774f717a0 /ext/spl/php_spl.c
parent41ef7fb555eda571347cf922832921935969d53b (diff)
downloadphp-git-d3ae24eb79c46583c335013002615dca174df6b7.tar.gz
- MFB Need to store length (and type) of class name
Diffstat (limited to 'ext/spl/php_spl.c')
-rwxr-xr-xext/spl/php_spl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c
index b56ef9cb6a..66b6bcc91d 100755
--- a/ext/spl/php_spl.c
+++ b/ext/spl/php_spl.c
@@ -341,6 +341,7 @@ static void autoload_func_info_dtor(autoload_func_info *alfi)
PHP_FUNCTION(spl_autoload_call)
{
zval **class_name, *retval = NULL;
+ int class_name_len, class_name_type;
char *func_name, *lc_name;
uint func_name_len;
ulong dummy;
@@ -353,7 +354,9 @@ PHP_FUNCTION(spl_autoload_call)
}
if (SPL_G(autoload_functions)) {
- lc_name = zend_u_str_tolower_dup(Z_TYPE_PP(class_name), Z_UNIVAL_PP(class_name), Z_UNILEN_PP(class_name));
+ class_name_type = Z_TYPE_PP(class_name);
+ class_name_len = Z_UNILEN_PP(class_name);
+ lc_name = zend_u_str_tolower_dup(class_name_type, Z_UNIVAL_PP(class_name), Z_UNILEN_PP(class_name));
zend_hash_internal_pointer_reset_ex(SPL_G(autoload_functions), &function_pos);
while(zend_hash_has_more_elements_ex(SPL_G(autoload_functions), &function_pos) == SUCCESS && !EG(exception)) {
zend_hash_get_current_key_ex(SPL_G(autoload_functions), &func_name, &func_name_len, &dummy, 0, &function_pos);
@@ -362,7 +365,7 @@ PHP_FUNCTION(spl_autoload_call)
if (retval) {
zval_ptr_dtor(&retval);
}
- if (zend_u_hash_exists(EG(class_table), Z_TYPE_PP(class_name), lc_name, Z_UNILEN_PP(class_name)+1)) {
+ if (zend_u_hash_exists(EG(class_table), class_name_type, lc_name, class_name_len+1)) {
break;
}
zend_hash_move_forward_ex(SPL_G(autoload_functions), &function_pos);