Hi
On 7/3/25 16:45, Ilija Tovilo wrote:
Deprecate passing spl_autoload_call() to spl_autoload_unregister()
Is such a check actually useful? We can prevent
spl_autoload_unregister(spl_autoload_call(...)), but we can't prevent
spl_autoload_unregister(fn($c) => spl_autoload_call($c)). It seems
very unlikely for this to happen accidentally, and excluding all
functions that don't make sense to pass is not feasible for obvious
reasons. But I don't care too much.
See also my reply to Niels. Such a check already exists:
https://github.com/php/php-src/blob/677a1f80c86b7a5848985bf44714210d0b89900b/ext/spl/php_spl.c#L583-L590
That's an explicit special case in the language that could go away.
Best regards
Tim Düsterhus