diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c index 0acfcbc5c16d0..bc8dde235aeff 100644 --- a/ext/spl/php_spl.c +++ b/ext/spl/php_spl.c @@ -34,7 +34,6 @@ #include "spl_heap.h" #include "zend_exceptions.h" #include "zend_interfaces.h" -#include "main/snprintf.h" ZEND_TLS zend_string *spl_autoload_extensions; ZEND_TLS HashTable *spl_autoload_functions; @@ -224,21 +223,19 @@ PHP_FUNCTION(spl_classes) } /* }}} */ -static int spl_autoload(zend_string *class_name, zend_string *lc_name, const char *ext, int ext_len) /* {{{ */ +static bool spl_autoload(zend_string *lc_name, const char *ext, size_t ext_len) /* {{{ */ { zend_string *class_file; zval dummy; zend_file_handle file_handle; - zend_op_array *new_op_array; zval result; - int ret; - class_file = zend_strpprintf(0, "%s%.*s", ZSTR_VAL(lc_name), ext_len, ext); + class_file = zend_string_concat2(ZSTR_VAL(lc_name), ZSTR_LEN(lc_name), ext, ext_len); #if DEFAULT_SLASH != '\\' { char *ptr = ZSTR_VAL(class_file); - char *end = ptr + ZSTR_LEN(class_file); + const char *end = ptr + ZSTR_LEN(class_file); while ((ptr = memchr(ptr, '\\', (end - ptr))) != NULL) { *ptr = DEFAULT_SLASH; @@ -246,22 +243,20 @@ static int spl_autoload(zend_string *class_name, zend_string *lc_name, const cha } #endif + bool ret = false; zend_stream_init_filename_ex(&file_handle, class_file); - ret = php_stream_open_for_zend_ex(&file_handle, USE_PATH|STREAM_OPEN_FOR_INCLUDE); - - if (ret == SUCCESS) { + if (php_stream_open_for_zend_ex(&file_handle, USE_PATH|STREAM_OPEN_FOR_INCLUDE) == SUCCESS) { zend_string *opened_path; if (!file_handle.opened_path) { file_handle.opened_path = zend_string_copy(class_file); } opened_path = zend_string_copy(file_handle.opened_path); ZVAL_NULL(&dummy); + zend_op_array *new_op_array = NULL; if (zend_hash_add(&EG(included_files), opened_path, &dummy)) { new_op_array = zend_compile_file(&file_handle, ZEND_REQUIRE); - } else { - new_op_array = NULL; } - zend_string_release_ex(opened_path, 0); + zend_string_release_ex(opened_path, false); if (new_op_array) { uint32_t orig_jit_trace_num = EG(jit_trace_num); @@ -271,24 +266,20 @@ static int spl_autoload(zend_string *class_name, zend_string *lc_name, const cha destroy_op_array(new_op_array); efree(new_op_array); - if (!EG(exception)) { - zval_ptr_dtor(&result); - } + zval_ptr_dtor(&result); - zend_destroy_file_handle(&file_handle); - zend_string_release(class_file); - return zend_hash_exists(EG(class_table), lc_name); + ret = zend_hash_exists(EG(class_table), lc_name); } } zend_destroy_file_handle(&file_handle); zend_string_release(class_file); - return 0; + return ret; } /* }}} */ /* {{{ Default autoloader implementation */ PHP_FUNCTION(spl_autoload) { - int pos_len, pos1_len; + size_t pos_len, pos1_len; char *pos, *pos1; zend_string *class_name, *lc_name, *file_exts = NULL; @@ -305,18 +296,18 @@ PHP_FUNCTION(spl_autoload) pos_len = sizeof(SPL_DEFAULT_FILE_EXTENSIONS) - 1; } else { pos = ZSTR_VAL(file_exts); - pos_len = (int)ZSTR_LEN(file_exts); + pos_len = ZSTR_LEN(file_exts); } lc_name = zend_string_tolower(class_name); while (pos && *pos && !EG(exception)) { pos1 = strchr(pos, ','); if (pos1) { - pos1_len = (int)(pos1 - pos); + pos1_len = (size_t)(pos1 - pos); } else { pos1_len = pos_len; } - if (spl_autoload(class_name, lc_name, pos, pos1_len)) { + if (spl_autoload(lc_name, pos, pos1_len)) { break; /* loaded */ } pos = pos1 ? pos1 + 1 : NULL; @@ -349,67 +340,11 @@ PHP_FUNCTION(spl_autoload_extensions) } } /* }}} */ -typedef struct { - zend_function *func_ptr; - zend_object *obj; - zend_object *closure; - zend_class_entry *ce; -} autoload_func_info; - -static void autoload_func_info_destroy(autoload_func_info *alfi) { - if (alfi->obj) { - zend_object_release(alfi->obj); - } - if (alfi->func_ptr && - UNEXPECTED(alfi->func_ptr->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) { - zend_string_release_ex(alfi->func_ptr->common.function_name, 0); - zend_free_trampoline(alfi->func_ptr); - } - if (alfi->closure) { - zend_object_release(alfi->closure); - } - efree(alfi); -} - static void autoload_func_info_zval_dtor(zval *element) { - autoload_func_info_destroy(Z_PTR_P(element)); -} - -static autoload_func_info *autoload_func_info_from_fci( - zend_fcall_info *fci, zend_fcall_info_cache *fcc) { - autoload_func_info *alfi = emalloc(sizeof(autoload_func_info)); - alfi->ce = fcc->calling_scope; - alfi->func_ptr = fcc->function_handler; - alfi->obj = fcc->object; - if (alfi->obj) { - GC_ADDREF(alfi->obj); - } - if (Z_TYPE(fci->function_name) == IS_OBJECT) { - alfi->closure = Z_OBJ(fci->function_name); - GC_ADDREF(alfi->closure); - } else { - alfi->closure = NULL; - } - return alfi; -} - -static bool autoload_func_info_equals( - const autoload_func_info *alfi1, const autoload_func_info *alfi2) { - if (UNEXPECTED( - (alfi1->func_ptr->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) && - (alfi2->func_ptr->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) - )) { - return alfi1->obj == alfi2->obj - && alfi1->ce == alfi2->ce - && alfi1->closure == alfi2->closure - && zend_string_equals(alfi1->func_ptr->common.function_name, alfi2->func_ptr->common.function_name) - ; - } - return alfi1->func_ptr == alfi2->func_ptr - && alfi1->obj == alfi2->obj - && alfi1->ce == alfi2->ce - && alfi1->closure == alfi2->closure; + zend_fcall_info_cache *fcc = Z_PTR_P(element); + zend_fcc_dtor(fcc); + efree(fcc); } static zend_class_entry *spl_perform_autoload(zend_string *class_name, zend_string *lc_name) { @@ -421,34 +356,27 @@ static zend_class_entry *spl_perform_autoload(zend_string *class_name, zend_stri * because autoloaders may be added/removed during autoloading. */ HashPosition pos; zend_hash_internal_pointer_reset_ex(spl_autoload_functions, &pos); - while (1) { - autoload_func_info *alfi = + + zval zname; + ZVAL_STR(&zname, class_name); + while (true) { + zend_fcall_info_cache *fcc = zend_hash_get_current_data_ptr_ex(spl_autoload_functions, &pos); - if (!alfi) { + if (!fcc) { break; } - zend_function *func = alfi->func_ptr; - if (UNEXPECTED(func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) { - func = emalloc(sizeof(zend_op_array)); - memcpy(func, alfi->func_ptr, sizeof(zend_op_array)); - zend_string_addref(func->op_array.function_name); - } - - zval param; - ZVAL_STR(¶m, class_name); - zend_call_known_function(func, alfi->obj, alfi->ce, NULL, 1, ¶m, NULL); - if (EG(exception)) { + zend_call_known_fcc(fcc, NULL, 1, &zname, NULL); + if (UNEXPECTED(EG(exception))) { break; } - if (ZSTR_HAS_CE_CACHE(class_name) && ZSTR_GET_CE_CACHE(class_name)) { + if (ZSTR_HAS_CE_CACHE(class_name) && ZSTR_GET_CE_CACHE(class_name)) { return (zend_class_entry*)ZSTR_GET_CE_CACHE(class_name); - } else { - zend_class_entry *ce = zend_hash_find_ptr(EG(class_table), lc_name); - if (ce) { - return ce; - } + } + zend_class_entry *ce = zend_hash_find_ptr(EG(class_table), lc_name); + if (ce != NULL) { + return ce; } zend_hash_move_forward_ex(spl_autoload_functions, &pos); @@ -470,24 +398,14 @@ PHP_FUNCTION(spl_autoload_call) zend_string_release(lc_name); } /* }}} */ -#define HT_MOVE_TAIL_TO_HEAD(ht) \ - ZEND_ASSERT(!HT_IS_PACKED(ht)); \ - do { \ - Bucket tmp = (ht)->arData[(ht)->nNumUsed-1]; \ - memmove((ht)->arData + 1, (ht)->arData, \ - sizeof(Bucket) * ((ht)->nNumUsed - 1)); \ - (ht)->arData[0] = tmp; \ - zend_hash_rehash(ht); \ - } while (0) - -static Bucket *spl_find_registered_function(autoload_func_info *find_alfi) { +static Bucket *spl_find_registered_function(const zend_fcall_info_cache *find_fcc) { if (!spl_autoload_functions) { return NULL; } - autoload_func_info *alfi; - ZEND_HASH_MAP_FOREACH_PTR(spl_autoload_functions, alfi) { - if (autoload_func_info_equals(alfi, find_alfi)) { + zend_fcall_info_cache *fcc; + ZEND_HASH_MAP_FOREACH_PTR(spl_autoload_functions, fcc) { + if (zend_fcc_equals(fcc, find_fcc)) { return _p; } } ZEND_HASH_FOREACH_END(); @@ -501,7 +419,6 @@ PHP_FUNCTION(spl_autoload_register) bool prepend = 0; zend_fcall_info fci = {0}; zend_fcall_info_cache fcc; - autoload_func_info *alfi; ZEND_PARSE_PARAMETERS_START(0, 3) Z_PARAM_OPTIONAL @@ -517,14 +434,14 @@ PHP_FUNCTION(spl_autoload_register) if (!spl_autoload_functions) { ALLOC_HASHTABLE(spl_autoload_functions); - zend_hash_init(spl_autoload_functions, 1, NULL, autoload_func_info_zval_dtor, 0); + zend_hash_init(spl_autoload_functions, 1, NULL, autoload_func_info_zval_dtor, false); /* Initialize as non-packed hash table for prepend functionality. */ zend_hash_real_init_mixed(spl_autoload_functions); } /* If first arg is not null */ if (ZEND_FCI_INITIALIZED(fci)) { - if (!fcc.function_handler) { + if (!ZEND_FCC_INITIALIZED(fcc)) { /* Call trampoline has been cleared by zpp. Refetch it, because we want to deal * with it ourselves. It is important that it is not refetched on every call, * because calls may occur from different scopes. */ @@ -536,33 +453,26 @@ PHP_FUNCTION(spl_autoload_register) zend_argument_value_error(1, "must not be the spl_autoload_call() function"); RETURN_THROWS(); } - - alfi = autoload_func_info_from_fci(&fci, &fcc); - if (UNEXPECTED(alfi->func_ptr == &EG(trampoline))) { - zend_function *copy = emalloc(sizeof(zend_op_array)); - - memcpy(copy, alfi->func_ptr, sizeof(zend_op_array)); - alfi->func_ptr->common.function_name = NULL; - alfi->func_ptr = copy; - } } else { - alfi = emalloc(sizeof(autoload_func_info)); - alfi->func_ptr = zend_hash_str_find_ptr( - CG(function_table), "spl_autoload", sizeof("spl_autoload") - 1); - alfi->obj = NULL; - alfi->ce = NULL; - alfi->closure = NULL; + memset(&fcc, 0, sizeof(fcc)); + fcc.function_handler = zend_hash_str_find_ptr(CG(function_table), ZEND_STRL("spl_autoload")); } - if (spl_find_registered_function(alfi)) { - autoload_func_info_destroy(alfi); + if (spl_find_registered_function(&fcc)) { + /* Release call trampoline */ + zend_release_fcall_info_cache(&fcc); RETURN_TRUE; } - zend_hash_next_index_insert_ptr(spl_autoload_functions, alfi); + zend_fcc_addref(&fcc); + zend_hash_next_index_insert_mem(spl_autoload_functions, &fcc, sizeof(zend_fcall_info_cache)); if (prepend && spl_autoload_functions->nNumOfElements > 1) { /* Move the newly created element to the head of the hashtable */ - HT_MOVE_TAIL_TO_HEAD(spl_autoload_functions); + ZEND_ASSERT(!HT_IS_PACKED(spl_autoload_functions)); + Bucket tmp = spl_autoload_functions->arData[spl_autoload_functions->nNumUsed-1]; + memmove(spl_autoload_functions->arData + 1, spl_autoload_functions->arData, sizeof(Bucket) * (spl_autoload_functions->nNumUsed - 1)); + spl_autoload_functions->arData[0] = tmp; + zend_hash_rehash(spl_autoload_functions); } RETURN_TRUE; @@ -575,11 +485,10 @@ PHP_FUNCTION(spl_autoload_unregister) zend_fcall_info_cache fcc; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_FUNC(fci, fcc) + Z_PARAM_FUNC_NO_TRAMPOLINE_FREE(fci, fcc) ZEND_PARSE_PARAMETERS_END(); - if (fcc.function_handler && zend_string_equals_literal( - fcc.function_handler->common.function_name, "spl_autoload_call")) { + if (zend_string_equals_literal(fcc.function_handler->common.function_name, "spl_autoload_call")) { php_error_docref(NULL, E_DEPRECATED, "Using spl_autoload_call() as a callback for spl_autoload_unregister() is deprecated," " to remove all registered autoloaders, call spl_autoload_unregister()" @@ -594,16 +503,9 @@ PHP_FUNCTION(spl_autoload_unregister) RETURN_TRUE; } - if (!fcc.function_handler) { - /* Call trampoline has been cleared by zpp. Refetch it, because we want to deal - * with it ourselves. It is important that it is not refetched on every call, - * because calls may occur from different scopes. */ - zend_is_callable_ex(&fci.function_name, NULL, 0, NULL, &fcc, NULL); - } - - autoload_func_info *alfi = autoload_func_info_from_fci(&fci, &fcc); - Bucket *p = spl_find_registered_function(alfi); - autoload_func_info_destroy(alfi); + Bucket *p = spl_find_registered_function(&fcc); + /* Release trampoline */ + zend_release_fcall_info_cache(&fcc); if (p) { zend_hash_del_bucket(spl_autoload_functions, p); RETURN_TRUE; @@ -615,32 +517,19 @@ PHP_FUNCTION(spl_autoload_unregister) /* {{{ Return all registered autoloader functions */ PHP_FUNCTION(spl_autoload_functions) { - autoload_func_info *alfi; - ZEND_PARSE_PARAMETERS_NONE(); - array_init(return_value); if (spl_autoload_functions) { - ZEND_HASH_MAP_FOREACH_PTR(spl_autoload_functions, alfi) { - if (alfi->closure) { - GC_ADDREF(alfi->closure); - add_next_index_object(return_value, alfi->closure); - } else if (alfi->func_ptr->common.scope) { - zval tmp; - - array_init(&tmp); - if (alfi->obj) { - GC_ADDREF(alfi->obj); - add_next_index_object(&tmp, alfi->obj); - } else { - add_next_index_str(&tmp, zend_string_copy(alfi->ce->name)); - } - add_next_index_str(&tmp, zend_string_copy(alfi->func_ptr->common.function_name)); - add_next_index_zval(return_value, &tmp); - } else { - add_next_index_str(return_value, zend_string_copy(alfi->func_ptr->common.function_name)); - } + zend_fcall_info_cache *fcc; + + array_init_size(return_value, zend_hash_num_elements(spl_autoload_functions)); + ZEND_HASH_MAP_FOREACH_PTR(spl_autoload_functions, fcc) { + zval tmp; + zend_get_callable_zval_from_fcc(fcc, &tmp); + add_next_index_zval(return_value, &tmp); } ZEND_HASH_FOREACH_END(); + } else { + RETURN_EMPTY_ARRAY(); } } /* }}} */ diff --git a/ext/spl/tests/bug38325.phpt b/ext/spl/tests/autoloading/bug38325.phpt similarity index 100% rename from ext/spl/tests/bug38325.phpt rename to ext/spl/tests/autoloading/bug38325.phpt diff --git a/ext/spl/tests/bug40091.phpt b/ext/spl/tests/autoloading/bug40091.phpt similarity index 100% rename from ext/spl/tests/bug40091.phpt rename to ext/spl/tests/autoloading/bug40091.phpt diff --git a/ext/spl/tests/bug44144.phpt b/ext/spl/tests/autoloading/bug44144.phpt similarity index 100% rename from ext/spl/tests/bug44144.phpt rename to ext/spl/tests/autoloading/bug44144.phpt diff --git a/ext/spl/tests/bug48023.phpt b/ext/spl/tests/autoloading/bug48023.phpt similarity index 100% rename from ext/spl/tests/bug48023.phpt rename to ext/spl/tests/autoloading/bug48023.phpt diff --git a/ext/spl/tests/bug48493.phpt b/ext/spl/tests/autoloading/bug48493.phpt similarity index 100% rename from ext/spl/tests/bug48493.phpt rename to ext/spl/tests/autoloading/bug48493.phpt diff --git a/ext/spl/tests/bug52339.phpt b/ext/spl/tests/autoloading/bug52339.phpt similarity index 100% rename from ext/spl/tests/bug52339.phpt rename to ext/spl/tests/autoloading/bug52339.phpt diff --git a/ext/spl/tests/bug61697.phpt b/ext/spl/tests/autoloading/bug61697.phpt similarity index 100% rename from ext/spl/tests/bug61697.phpt rename to ext/spl/tests/autoloading/bug61697.phpt diff --git a/ext/spl/tests/bug65006.phpt b/ext/spl/tests/autoloading/bug65006.phpt similarity index 100% rename from ext/spl/tests/bug65006.phpt rename to ext/spl/tests/autoloading/bug65006.phpt diff --git a/ext/spl/tests/bug71202.phpt b/ext/spl/tests/autoloading/bug71202.phpt similarity index 100% rename from ext/spl/tests/bug71202.phpt rename to ext/spl/tests/autoloading/bug71202.phpt diff --git a/ext/spl/tests/bug71204.phpt b/ext/spl/tests/autoloading/bug71204.phpt similarity index 100% rename from ext/spl/tests/bug71204.phpt rename to ext/spl/tests/autoloading/bug71204.phpt diff --git a/ext/spl/tests/bug71236.phpt b/ext/spl/tests/autoloading/bug71236.phpt similarity index 100% rename from ext/spl/tests/bug71236.phpt rename to ext/spl/tests/autoloading/bug71236.phpt diff --git a/ext/spl/tests/bug73896.phpt b/ext/spl/tests/autoloading/bug73896.phpt similarity index 100% rename from ext/spl/tests/bug73896.phpt rename to ext/spl/tests/autoloading/bug73896.phpt diff --git a/ext/spl/tests/bug74372.phpt b/ext/spl/tests/autoloading/bug74372.phpt similarity index 100% rename from ext/spl/tests/bug74372.phpt rename to ext/spl/tests/autoloading/bug74372.phpt diff --git a/ext/spl/tests/bug75049.phpt b/ext/spl/tests/autoloading/bug75049.phpt similarity index 100% rename from ext/spl/tests/bug75049.phpt rename to ext/spl/tests/autoloading/bug75049.phpt diff --git a/ext/spl/tests/gh10011.phpt b/ext/spl/tests/autoloading/gh10011.phpt similarity index 100% rename from ext/spl/tests/gh10011.phpt rename to ext/spl/tests/autoloading/gh10011.phpt diff --git a/ext/spl/tests/spl_autoload_001.phpt b/ext/spl/tests/autoloading/spl_autoload_001.phpt similarity index 100% rename from ext/spl/tests/spl_autoload_001.phpt rename to ext/spl/tests/autoloading/spl_autoload_001.phpt diff --git a/ext/spl/tests/spl_autoload_002.phpt b/ext/spl/tests/autoloading/spl_autoload_002.phpt similarity index 100% rename from ext/spl/tests/spl_autoload_002.phpt rename to ext/spl/tests/autoloading/spl_autoload_002.phpt diff --git a/ext/spl/tests/spl_autoload_003.phpt b/ext/spl/tests/autoloading/spl_autoload_003.phpt similarity index 100% rename from ext/spl/tests/spl_autoload_003.phpt rename to ext/spl/tests/autoloading/spl_autoload_003.phpt diff --git a/ext/spl/tests/spl_autoload_004.phpt b/ext/spl/tests/autoloading/spl_autoload_004.phpt similarity index 100% rename from ext/spl/tests/spl_autoload_004.phpt rename to ext/spl/tests/autoloading/spl_autoload_004.phpt diff --git a/ext/spl/tests/spl_autoload_005.phpt b/ext/spl/tests/autoloading/spl_autoload_005.phpt similarity index 100% rename from ext/spl/tests/spl_autoload_005.phpt rename to ext/spl/tests/autoloading/spl_autoload_005.phpt diff --git a/ext/spl/tests/spl_autoload_006.phpt b/ext/spl/tests/autoloading/spl_autoload_006.phpt similarity index 100% rename from ext/spl/tests/spl_autoload_006.phpt rename to ext/spl/tests/autoloading/spl_autoload_006.phpt diff --git a/ext/spl/tests/spl_autoload_007.phpt b/ext/spl/tests/autoloading/spl_autoload_007.phpt similarity index 100% rename from ext/spl/tests/spl_autoload_007.phpt rename to ext/spl/tests/autoloading/spl_autoload_007.phpt diff --git a/ext/spl/tests/spl_autoload_008.phpt b/ext/spl/tests/autoloading/spl_autoload_008.phpt similarity index 100% rename from ext/spl/tests/spl_autoload_008.phpt rename to ext/spl/tests/autoloading/spl_autoload_008.phpt diff --git a/ext/spl/tests/spl_autoload_009.phpt b/ext/spl/tests/autoloading/spl_autoload_009.phpt similarity index 100% rename from ext/spl/tests/spl_autoload_009.phpt rename to ext/spl/tests/autoloading/spl_autoload_009.phpt diff --git a/ext/spl/tests/spl_autoload_010.phpt b/ext/spl/tests/autoloading/spl_autoload_010.phpt similarity index 100% rename from ext/spl/tests/spl_autoload_010.phpt rename to ext/spl/tests/autoloading/spl_autoload_010.phpt diff --git a/ext/spl/tests/spl_autoload_011.phpt b/ext/spl/tests/autoloading/spl_autoload_011.phpt similarity index 100% rename from ext/spl/tests/spl_autoload_011.phpt rename to ext/spl/tests/autoloading/spl_autoload_011.phpt diff --git a/ext/spl/tests/spl_autoload_012.phpt b/ext/spl/tests/autoloading/spl_autoload_012.phpt similarity index 100% rename from ext/spl/tests/spl_autoload_012.phpt rename to ext/spl/tests/autoloading/spl_autoload_012.phpt diff --git a/ext/spl/tests/spl_autoload_013.phpt b/ext/spl/tests/autoloading/spl_autoload_013.phpt similarity index 100% rename from ext/spl/tests/spl_autoload_013.phpt rename to ext/spl/tests/autoloading/spl_autoload_013.phpt diff --git a/ext/spl/tests/spl_autoload_014.phpt b/ext/spl/tests/autoloading/spl_autoload_014.phpt similarity index 100% rename from ext/spl/tests/spl_autoload_014.phpt rename to ext/spl/tests/autoloading/spl_autoload_014.phpt diff --git a/ext/spl/tests/spl_autoload_bug48541.phpt b/ext/spl/tests/autoloading/spl_autoload_bug48541.phpt similarity index 100% rename from ext/spl/tests/spl_autoload_bug48541.phpt rename to ext/spl/tests/autoloading/spl_autoload_bug48541.phpt diff --git a/ext/spl/tests/spl_autoload_call_basic.phpt b/ext/spl/tests/autoloading/spl_autoload_call_basic.phpt similarity index 100% rename from ext/spl/tests/spl_autoload_call_basic.phpt rename to ext/spl/tests/autoloading/spl_autoload_call_basic.phpt diff --git a/ext/spl/tests/spl_autoload_called_scope.phpt b/ext/spl/tests/autoloading/spl_autoload_called_scope.phpt similarity index 100% rename from ext/spl/tests/spl_autoload_called_scope.phpt rename to ext/spl/tests/autoloading/spl_autoload_called_scope.phpt diff --git a/ext/spl/tests/spl_autoload_throw_with_spl_autoloader_call_as_autoloader.phpt b/ext/spl/tests/autoloading/spl_autoload_throw_with_spl_autoloader_call_as_autoloader.phpt similarity index 100% rename from ext/spl/tests/spl_autoload_throw_with_spl_autoloader_call_as_autoloader.phpt rename to ext/spl/tests/autoloading/spl_autoload_throw_with_spl_autoloader_call_as_autoloader.phpt diff --git a/ext/spl/tests/spl_autoload_unregister_without_registrations.phpt b/ext/spl/tests/autoloading/spl_autoload_unregister_without_registrations.phpt similarity index 100% rename from ext/spl/tests/spl_autoload_unregister_without_registrations.phpt rename to ext/spl/tests/autoloading/spl_autoload_unregister_without_registrations.phpt diff --git a/ext/spl/tests/spl_autoload_warn_on_false_do_throw.phpt b/ext/spl/tests/autoloading/spl_autoload_warn_on_false_do_throw.phpt similarity index 100% rename from ext/spl/tests/spl_autoload_warn_on_false_do_throw.phpt rename to ext/spl/tests/autoloading/spl_autoload_warn_on_false_do_throw.phpt diff --git a/ext/spl/tests/testclass b/ext/spl/tests/autoloading/testclass similarity index 100% rename from ext/spl/tests/testclass rename to ext/spl/tests/autoloading/testclass diff --git a/ext/spl/tests/testclass.class.inc b/ext/spl/tests/autoloading/testclass.class.inc similarity index 100% rename from ext/spl/tests/testclass.class.inc rename to ext/spl/tests/autoloading/testclass.class.inc diff --git a/ext/spl/tests/testclass.inc b/ext/spl/tests/autoloading/testclass.inc similarity index 100% rename from ext/spl/tests/testclass.inc rename to ext/spl/tests/autoloading/testclass.inc diff --git a/ext/spl/tests/testclass.php.inc b/ext/spl/tests/autoloading/testclass.php.inc similarity index 100% rename from ext/spl/tests/testclass.php.inc rename to ext/spl/tests/autoloading/testclass.php.inc