php-src/ext/spl/php_spl.stub.php
Nikita Popov 5b59d4915c Cleanup SPL autoload implementation
Replace EG(autoload_func) with a C level zend_autoload hook.
This avoids having to do one indirection through PHP function
calls. The need for EG(autoload_func) was a leftover from the
__autoload() implementation.

Additionally, drop special-casing of spl_autoload(), and instead
register it just like any other autoloading function. This fixes
bug #71236 as a side-effect.

Finally, change spl_autoload_functions() to always return an array.
The distinction between false and an empty array no longer makes
sense here.

Closes GH-5696.
2020-06-10 09:38:47 +02:00

33 lines
1 KiB
PHP
Executable file

<?php
/** @generate-function-entries */
function class_implements($what, bool $autoload = true): array|false {}
function class_parents($instance, bool $autoload = true): array|false {}
function class_uses($what, bool $autoload = true): array|false {}
function spl_autoload(string $class_name, ?string $file_extensions = null): void {}
function spl_autoload_call(string $class_name): void {}
function spl_autoload_extensions(?string $file_extensions = null): string {}
function spl_autoload_functions(): array {}
function spl_autoload_register(?callable $autoload_function = null, bool $throw = true, bool $prepend = false): bool {}
function spl_autoload_unregister($autoload_function): bool {}
function spl_classes(): array {}
function spl_object_hash(object $obj): string {}
function spl_object_id(object $obj): int {}
function iterator_apply(Traversable $iterator, callable $function, ?array $args = null): int {}
function iterator_count(Traversable $iterator): int {}
function iterator_to_array(Traversable $iterator, bool $use_keys = true): array {}