{
int pos_len, pos1_len;
char *pos, *pos1;
- zend_string *class_name, *lc_name, *file_exts = SPL_G(autoload_extensions);
+ zend_string *class_name, *lc_name, *file_exts = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|S", &class_name, &file_exts) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|S!", &class_name, &file_exts) == FAILURE) {
RETURN_THROWS();
}
+ if (!file_exts) {
+ file_exts = SPL_G(autoload_extensions);
+ }
+
if (file_exts == NULL) { /* autoload_extensions is not initialized, set to defaults */
pos = SPL_DEFAULT_FILE_EXTENSIONS;
pos_len = sizeof(SPL_DEFAULT_FILE_EXTENSIONS) - 1;
{
zend_string *file_exts = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "|S", &file_exts) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|S!", &file_exts) == FAILURE) {
RETURN_THROWS();
}
+
if (file_exts) {
if (SPL_G(autoload_extensions)) {
zend_string_release_ex(SPL_G(autoload_extensions), 0);
zend_object *obj_ptr;
zend_fcall_info_cache fcc;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "|zbb", &zcallable, &do_throw, &prepend) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z!bb", &zcallable, &do_throw, &prepend) == FAILURE) {
RETURN_THROWS();
}
- if (ZEND_NUM_ARGS()) {
+ if (zcallable) {
if (!zend_is_callable_ex(zcallable, NULL, 0, &func_name, &fcc, &error)) {
alfi.ce = fcc.calling_scope;
alfi.func_ptr = fcc.function_handler;
function class_uses($what, bool $autoload = true): array|false {}
-function spl_autoload(string $class_name, string $file_extensions = UNKNOWN): void {}
+function spl_autoload(string $class_name, ?string $file_extensions = null): void {}
// This silently ignores non-string class names
function spl_autoload_call($class_name): void {}
-function spl_autoload_extensions(string $file_extensions = UNKNOWN): string {}
+function spl_autoload_extensions(?string $file_extensions = null): string {}
function spl_autoload_functions(): array|false {}
-function spl_autoload_register($autoload_function = UNKNOWN, bool $throw = true, bool $prepend = false): bool {}
+function spl_autoload_register($autoload_function = null, bool $throw = true, bool $prepend = false): bool {}
function spl_autoload_unregister($autoload_function): bool {}
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_spl_autoload, 0, 1, IS_VOID, 0)
ZEND_ARG_TYPE_INFO(0, class_name, IS_STRING, 0)
- ZEND_ARG_TYPE_INFO(0, file_extensions, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, file_extensions, IS_STRING, 1, "null")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_spl_autoload_call, 0, 1, IS_VOID, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_spl_autoload_extensions, 0, 0, IS_STRING, 0)
- ZEND_ARG_TYPE_INFO(0, file_extensions, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, file_extensions, IS_STRING, 1, "null")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_spl_autoload_functions, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_spl_autoload_register, 0, 0, _IS_BOOL, 0)
- ZEND_ARG_INFO(0, autoload_function)
+ ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, autoload_function, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, throw, _IS_BOOL, 0, "true")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, prepend, _IS_BOOL, 0, "false")
ZEND_END_ARG_INFO()