Skip to content

Conversation

herndlm
Copy link
Contributor

@herndlm herndlm commented Oct 24, 2022

array_fill_keys: https://3v4l.org/8ik8V
array_flip: https://3v4l.org/jBASO
array_keys: https://3v4l.org/TYWrU
array_values: https://3v4l.org/89UDN

I was lazy with the pre PHP 8 checks and just wrapped them in conditionals like I did it with array_search. should the test files be split maybe to assert this for PHP < 8 as well? or not worth the hassle? hmm. we could maybe also move them all out to 2 test files only. e.g. non-array-array-functions.php and non-array-array-functions-php8.php or so

@herndlm herndlm marked this pull request as ready for review October 24, 2022 20:32
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@ondrejmirtes
Copy link
Member

Awesome, thank you!

@ondrejmirtes ondrejmirtes merged commit fec8acc into phpstan:1.9.x Oct 25, 2022
@herndlm herndlm deleted the array-functions-non-array branch October 25, 2022 14:23
@herndlm
Copy link
Contributor Author

herndlm commented Oct 25, 2022

are you fine with the tests like that or should I add more / split them so that we have more executing on PHP < 8 as well?

@ondrejmirtes
Copy link
Member

The best would be (for each function):

  • Have common file that's always tested on every PHP version for things that don't change
  • Have a PHP 7 specific file
  • Have a PHP 8 specific file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants