42#define SPL_DEFAULT_FILE_EXTENSIONS ".inc,.php"
51 ce = zend_hash_find_ptr(
EG(class_table), lc_name);
52 zend_string_release(lc_name);
82 if (
NULL == (ce = spl_find_ce_by_name(
Z_STR_P(obj), autoload))) {
91 while (parent_class) {
93 parent_class = parent_class->
parent;
115 if (
NULL == (ce = spl_find_ce_by_name(
Z_STR_P(obj), autoload))) {
144 if (
NULL == (ce = spl_find_ce_by_name(
Z_STR_P(obj), autoload))) {
156#define SPL_ADD_CLASS(class_name, z_list, sub, allow, ce_flags) \
157 spl_add_classes(spl_ce_ ## class_name, z_list, sub, allow, ce_flags)
159#define SPL_LIST_CLASSES(z_list, sub, allow, ce_flags) \
160 SPL_ADD_CLASS(AppendIterator, z_list, sub, allow, ce_flags); \
161 SPL_ADD_CLASS(ArrayIterator, z_list, sub, allow, ce_flags); \
162 SPL_ADD_CLASS(ArrayObject, z_list, sub, allow, ce_flags); \
163 SPL_ADD_CLASS(BadFunctionCallException, z_list, sub, allow, ce_flags); \
164 SPL_ADD_CLASS(BadMethodCallException, z_list, sub, allow, ce_flags); \
165 SPL_ADD_CLASS(CachingIterator, z_list, sub, allow, ce_flags); \
166 SPL_ADD_CLASS(CallbackFilterIterator, z_list, sub, allow, ce_flags); \
167 SPL_ADD_CLASS(DirectoryIterator, z_list, sub, allow, ce_flags); \
168 SPL_ADD_CLASS(DomainException, z_list, sub, allow, ce_flags); \
169 SPL_ADD_CLASS(EmptyIterator, z_list, sub, allow, ce_flags); \
170 SPL_ADD_CLASS(FilesystemIterator, z_list, sub, allow, ce_flags); \
171 SPL_ADD_CLASS(FilterIterator, z_list, sub, allow, ce_flags); \
172 SPL_ADD_CLASS(GlobIterator, z_list, sub, allow, ce_flags); \
173 SPL_ADD_CLASS(InfiniteIterator, z_list, sub, allow, ce_flags); \
174 SPL_ADD_CLASS(InvalidArgumentException, z_list, sub, allow, ce_flags); \
175 SPL_ADD_CLASS(IteratorIterator, z_list, sub, allow, ce_flags); \
176 SPL_ADD_CLASS(LengthException, z_list, sub, allow, ce_flags); \
177 SPL_ADD_CLASS(LimitIterator, z_list, sub, allow, ce_flags); \
178 SPL_ADD_CLASS(LogicException, z_list, sub, allow, ce_flags); \
179 SPL_ADD_CLASS(MultipleIterator, z_list, sub, allow, ce_flags); \
180 SPL_ADD_CLASS(NoRewindIterator, z_list, sub, allow, ce_flags); \
181 SPL_ADD_CLASS(OuterIterator, z_list, sub, allow, ce_flags); \
182 SPL_ADD_CLASS(OutOfBoundsException, z_list, sub, allow, ce_flags); \
183 SPL_ADD_CLASS(OutOfRangeException, z_list, sub, allow, ce_flags); \
184 SPL_ADD_CLASS(OverflowException, z_list, sub, allow, ce_flags); \
185 SPL_ADD_CLASS(ParentIterator, z_list, sub, allow, ce_flags); \
186 SPL_ADD_CLASS(RangeException, z_list, sub, allow, ce_flags); \
187 SPL_ADD_CLASS(RecursiveArrayIterator, z_list, sub, allow, ce_flags); \
188 SPL_ADD_CLASS(RecursiveCachingIterator, z_list, sub, allow, ce_flags); \
189 SPL_ADD_CLASS(RecursiveCallbackFilterIterator, z_list, sub, allow, ce_flags); \
190 SPL_ADD_CLASS(RecursiveDirectoryIterator, z_list, sub, allow, ce_flags); \
191 SPL_ADD_CLASS(RecursiveFilterIterator, z_list, sub, allow, ce_flags); \
192 SPL_ADD_CLASS(RecursiveIterator, z_list, sub, allow, ce_flags); \
193 SPL_ADD_CLASS(RecursiveIteratorIterator, z_list, sub, allow, ce_flags); \
194 SPL_ADD_CLASS(RecursiveRegexIterator, z_list, sub, allow, ce_flags); \
195 SPL_ADD_CLASS(RecursiveTreeIterator, z_list, sub, allow, ce_flags); \
196 SPL_ADD_CLASS(RegexIterator, z_list, sub, allow, ce_flags); \
197 SPL_ADD_CLASS(RuntimeException, z_list, sub, allow, ce_flags); \
198 SPL_ADD_CLASS(SeekableIterator, z_list, sub, allow, ce_flags); \
199 SPL_ADD_CLASS(SplDoublyLinkedList, z_list, sub, allow, ce_flags); \
200 SPL_ADD_CLASS(SplFileInfo, z_list, sub, allow, ce_flags); \
201 SPL_ADD_CLASS(SplFileObject, z_list, sub, allow, ce_flags); \
202 SPL_ADD_CLASS(SplFixedArray, z_list, sub, allow, ce_flags); \
203 SPL_ADD_CLASS(SplHeap, z_list, sub, allow, ce_flags); \
204 SPL_ADD_CLASS(SplMinHeap, z_list, sub, allow, ce_flags); \
205 SPL_ADD_CLASS(SplMaxHeap, z_list, sub, allow, ce_flags); \
206 SPL_ADD_CLASS(SplObjectStorage, z_list, sub, allow, ce_flags); \
207 SPL_ADD_CLASS(SplObserver, z_list, sub, allow, ce_flags); \
208 SPL_ADD_CLASS(SplPriorityQueue, z_list, sub, allow, ce_flags); \
209 SPL_ADD_CLASS(SplQueue, z_list, sub, allow, ce_flags); \
210 SPL_ADD_CLASS(SplStack, z_list, sub, allow, ce_flags); \
211 SPL_ADD_CLASS(SplSubject, z_list, sub, allow, ce_flags); \
212 SPL_ADD_CLASS(SplTempFileObject, z_list, sub, allow, ce_flags); \
213 SPL_ADD_CLASS(UnderflowException, z_list, sub, allow, ce_flags); \
214 SPL_ADD_CLASS(UnexpectedValueException, z_list, sub, allow, ce_flags); \
240#if DEFAULT_SLASH != '\\'
257 file_handle.
opened_path = zend_string_copy(class_file);
259 opened_path = zend_string_copy(file_handle.
opened_path);
268 uint32_t orig_jit_trace_num =
EG(jit_trace_num);
272 EG(jit_trace_num) = orig_jit_trace_num;
281 zend_string_release(class_file);
282 return zend_hash_exists(
EG(class_table), lc_name);
286 zend_string_release(class_file);
293 int pos_len, pos1_len;
305 if (file_exts ==
NULL) {
313 lc_name = zend_string_tolower(class_name);
317 pos1_len = (int)(pos1 -
pos);
321 if (spl_autoload(class_name, lc_name,
pos, pos1_len)) {
325 pos_len = pos1? pos_len - pos1_len - 1 : 0;
327 zend_string_release(lc_name);
363 zend_object_release(alfi->
obj);
371 zend_object_release(alfi->
closure);
376static void autoload_func_info_zval_dtor(
zval *element)
378 autoload_func_info_destroy(
Z_PTR_P(element));
399static bool autoload_func_info_equals(
405 return alfi1->
obj == alfi2->
obj
406 && alfi1->
ce == alfi2->
ce
412 && alfi1->
obj == alfi2->
obj
413 && alfi1->
ce == alfi2->
ce
437 zend_string_addref(
func->op_array.function_name);
470 zend_string *lc_name = zend_string_tolower(class_name);
471 spl_perform_autoload(class_name, lc_name);
472 zend_string_release(lc_name);
475#define HT_MOVE_TAIL_TO_HEAD(ht) \
476 ZEND_ASSERT(!HT_IS_PACKED(ht)); \
478 Bucket tmp = (ht)->arData[(ht)->nNumUsed-1]; \
479 memmove((ht)->arData + 1, (ht)->arData, \
480 sizeof(Bucket) * ((ht)->nNumUsed - 1)); \
481 (ht)->arData[0] = tmp; \
482 zend_hash_rehash(ht); \
492 if (autoload_func_info_equals(alfi, find_alfi)) {
517 "spl_autoload_register() will always throw");
542 alfi = autoload_func_info_from_fci(&fci, &fcc);
552 alfi->
func_ptr = zend_hash_str_find_ptr(
553 CG(function_table),
"spl_autoload",
sizeof(
"spl_autoload") - 1);
559 if (spl_find_registered_function(alfi)) {
560 autoload_func_info_destroy(alfi);
600 Bucket *
p = spl_find_registered_function(alfi);
601 autoload_func_info_destroy(alfi);
676static void spl_build_class_list_string(
zval *entry,
char **list)
698 spl_build_class_list_string(
zv, &strg);
708 spl_build_class_list_string(
zv, &strg);
file_private const char ext[]
copy(string $from, string $to, $context=null)
strchr(string $haystack, string $needle, bool $before_needle=false)
PHPAPI zend_result php_stream_open_for_zend_ex(zend_file_handle *handle, int mode)
PHPAPI ZEND_COLD void php_error_docref(const char *docref, int type, const char *format,...)
php_info_print_table_start()
php_info_print_table_row(2, "PDO Driver for Firebird", "enabled")
php_info_print_table_end()
#define PHP_MINIT_FUNCTION
#define PHP_MINFO_FUNCTION
#define PHP_RINIT_FUNCTION
#define PHP_RSHUTDOWN_FUNCTION
unsigned const char * end
unsigned const char * pos
#define SPL_DEFAULT_FILE_EXTENSIONS
ZEND_TLS zend_string * spl_autoload_extensions
PHPAPI zend_string * php_spl_object_hash(zend_object *obj)
zend_module_entry spl_module_entry
#define SPL_LIST_CLASSES(z_list, sub, allow, ce_flags)
#define HT_MOVE_TAIL_TO_HEAD(ht)
ZEND_TLS HashTable * spl_autoload_functions
spl_autoload_register(?callable $callback=null, bool $throw=true, bool $prepend=false)
spl_object_id(object $object)
class_uses($object_or_class, bool $autoload=true)
spl_autoload_call(string $class)
class_parents($object_or_class, bool $autoload=true)
spl_object_hash(object $object)
class_implements($object_or_class, bool $autoload=true)
spl_autoload_unregister(callable $callback)
#define STREAM_OPEN_FOR_INCLUDE
struct _spl_fixedarray spl_fixedarray
void spl_add_class_name(zval *list, zend_class_entry *pce, int allow, int ce_flags)
void spl_add_interfaces(zval *list, zend_class_entry *pce, int allow, int ce_flags)
void spl_add_traits(zval *list, zend_class_entry *pce, int allow, int ce_flags)
zend_class_entry * parent
zend_class_entry * calling_scope
zend_function * function_handler
zend_string * opened_path
zend_string * function_name
struct _zend_function::@236135173067030250234125302313220025134003177336 common
zend_internal_function internal_function
ZEND_API zend_string * zend_strpprintf(size_t max_len, const char *format,...)
ZEND_API const char * zend_zval_value_name(const zval *arg)
ZEND_API zend_result add_next_index_object(zval *arg, zend_object *obj)
ZEND_API zend_result zend_parse_parameters(uint32_t num_args, const char *type_spec,...)
ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error)
ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *format,...)
ZEND_API ZEND_COLD void zend_argument_type_error(uint32_t arg_num, const char *format,...)
ZEND_API zend_result add_next_index_str(zval *arg, zend_string *str)
#define Z_PARAM_FUNC(dest_fci, dest_fcc)
struct _zend_fcall_info_cache zend_fcall_info_cache
#define RETURN_STRINGL(s, l)
#define ZEND_PARSE_PARAMETERS_END()
#define IS_CALLABLE_SUPPRESS_DEPRECATIONS
#define zend_parse_parameters_none()
#define ZEND_FCI_INITIALIZED(fci)
#define ZEND_PARSE_PARAMETERS_START(min_num_args, max_num_args)
#define RETURN_NEW_STR(s)
struct _zend_fcall_info zend_fcall_info
#define Z_PARAM_OBJ(dest)
#define Z_PARAM_BOOL(dest)
ZEND_API void zend_call_known_function(zend_function *fn, zend_object *object, zend_class_entry *called_scope, zval *retval_ptr, uint32_t param_count, zval *params, HashTable *named_params)
#define Z_PARAM_FUNC_OR_NULL(dest_fci, dest_fcc)
#define FREE_HASHTABLE(ht)
#define ALLOC_HASHTABLE(ht)
zend_string_release_ex(func->internal_function.function_name, 0)
ZEND_API zend_op_array *(* zend_compile_file)(zend_file_handle *file_handle, int type)
ZEND_API void destroy_op_array(zend_op_array *op_array)
#define ZEND_INTERNAL_FUNCTION
#define ZEND_ACC_INTERFACE
#define ZEND_ACC_CALL_VIA_TRAMPOLINE
struct _zend_op_array zend_op_array
ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle)
ZEND_API zend_class_entry * zend_lookup_class(zend_string *name)
ZEND_API void zend_execute(zend_op_array *op_array, zval *return_value)
ZEND_API zend_class_entry *(* zend_autoload)(zend_string *name, zend_string *lc_name)
union _zend_function zend_function
ZEND_API void ZEND_FASTCALL zend_hash_destroy(HashTable *ht)
ZEND_API zend_result ZEND_FASTCALL zend_hash_move_forward_ex(HashTable *ht, HashPosition *pos)
ZEND_API void ZEND_FASTCALL zend_hash_internal_pointer_reset_ex(HashTable *ht, HashPosition *pos)
ZEND_API void ZEND_FASTCALL zend_hash_clean(HashTable *ht)
ZEND_API void ZEND_FASTCALL zend_hash_del_bucket(HashTable *ht, Bucket *p)
ZEND_API void ZEND_FASTCALL zend_array_destroy(HashTable *ht)
ZEND_API void ZEND_FASTCALL zend_hash_real_init_mixed(HashTable *ht)
ZEND_API zval *ZEND_FASTCALL zend_hash_add(HashTable *ht, zend_string *key, zval *pData)
#define zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent)
#define ZEND_HASH_MAP_FOREACH_VAL(ht, _val)
#define ZEND_HASH_MAP_FOREACH_PTR(ht, _ptr)
#define ZEND_HASH_FOREACH_END()
struct _zend_file_handle zend_file_handle
struct _zend_string zend_string
#define INIT_FUNC_ARGS_PASSTHRU
struct _zend_module_dep zend_module_dep
struct _zend_module_entry zend_module_entry
#define STANDARD_MODULE_PROPERTIES
#define ZEND_MOD_REQUIRED(name)
#define STANDARD_MODULE_HEADER_EX
#define zend_free_trampoline(func)
#define UNEXPECTED(condition)
struct _zend_class_entry zend_class_entry
struct _zend_object zend_object
ZEND_API void zend_stream_init_filename_ex(zend_file_handle *handle, zend_string *filename)
#define zend_string_equals_literal(str, literal)
#define Z_STRVAL_P(zval_p)
#define Z_ARRVAL_P(zval_p)
struct _zend_array HashTable
#define ZSTR_HAS_CE_CACHE(s)
#define Z_OBJCE_P(zval_p)
#define ZSTR_GET_CE_CACHE(s)
ZEND_API void zval_ptr_dtor(zval *zval_ptr)