Fix extract signature
Closes https://github.com/phpstan/phpstan/issues/11759
Params names are coming from https://www.php.net/manual/en/function.extract.php They are also here: https://github.com/php/php-src/blob/7e45e57d8f85f8d1fa2521028f394da30268187d/ext/standard/basic_functions.stub.php#L1643-L1644
I added some tests to check & does not break the extract inference.
Is something more needed for this PR ? @ondrejmirtes
The param names should be the ones from php7. Reflection takes care of the correct names for 8.x.
The param names should be the ones from php7. Reflection takes care of the correct names for 8.x.
Was the param names different in php 7 ?
Was the param names different in php 7 ?
See https://3v4l.org/kMrVd . The current parameter names aren’t exactly those of PHP 7 either…
Since named parameter is only a PHP 8 feature, isn't it better to use them in stubs ? I'm not sure what's the best for PHPStan
Also: please search for @prefer-ref in vendor/phpstan/php-8-stubs and update all the functions you find too.
Would make more sense to test this separately in a different function.
Done in https://github.com/phpstan/phpstan-src/pull/3512/commits/f9fa213fc39e2b9b4f9817dba28e030fa51cfb5c
Also: please search for
@prefer-refin vendor/phpstan/php-8-stubs and update all the functions you find too.
Done in https://github.com/phpstan/phpstan-src/pull/3512/commits/b5e5de50331a0e6eb8f7af1440d04bba619d9232 if I understood correctly
Thank you.