phpstan-src icon indicating copy to clipboard operation
phpstan-src copied to clipboard

Update return type of `spl_autoload_functions` on PHP8.0+

Open ManuelHu opened this issue 2 years ago • 1 comments

The documentation states that spl_autoload_functions might only return false on PHP versions up to 7.4; it will return an empty array on PHP8+.

The PHP8.x stubs already have the (only) correct native return type array specified - with this change the functionMap type should be a subtype of it.

ManuelHu avatar Dec 08 '23 12:12 ManuelHu

You've opened the pull request against the latest branch 1.11.x. If your code is relevant on 1.10.x and you want it to be released sooner, please rebase your pull request and change its target to 1.10.x.

phpstan-bot avatar Dec 08 '23 12:12 phpstan-bot

@ondrejmirtes This (already very old) PR should now be ready for review and merging. I hope I did everythng right for the version specific signatures, at least it seems to work.

This might break some custom @var type annotations (like here in PHPStan), should this maybe go into bleeding edge for now?

ManuelHu avatar Sep 27 '24 18:09 ManuelHu

This is okay, thank you.

ondrejmirtes avatar Oct 06 '24 14:10 ondrejmirtes