Skip to content

Remove specific configuration for array_fill() with PHP 8#701

Merged
ondrejmirtes merged 1 commit intophpstan:masterfrom
steevanb:array-fill
Oct 7, 2021
Merged

Remove specific configuration for array_fill() with PHP 8#701
ondrejmirtes merged 1 commit intophpstan:masterfrom
steevanb:array-fill

Conversation

@steevanb
Copy link
Copy Markdown
Contributor

@steevanb steevanb commented Oct 6, 2021

PHP 8 allow array_fill() $start_key parameter to be less than 0, as PHP 7.x does:
http://sandbox.onlinephpfunctions.com/code/f41f7ca4e9acd877de048ff3d7905f8d354d99c2

A little difference is: with PHP 7.x if you have a negative number for $start_index, first index will be your number but next one will be 0:
http://sandbox.onlinephpfunctions.com/code/f41f7ca4e9acd877de048ff3d7905f8d354d99c2

With PHP 8 it will not be 0 but the next number:
http://sandbox.onlinephpfunctions.com/code/f41f7ca4e9acd877de048ff3d7905f8d354d99c2

@ondrejmirtes ondrejmirtes merged commit 98f0b02 into phpstan:master Oct 7, 2021
@ondrejmirtes
Copy link
Copy Markdown
Member

Thank you! /cc @staabm

@steevanb
Copy link
Copy Markdown
Contributor Author

steevanb commented Oct 7, 2021

Thanks!

Do you know when 0.12.100 will be available with this fix?

@ondrejmirtes
Copy link
Copy Markdown
Member

There isn't gonna be one. This fix is going to be out with PHPStan 1.0 in a few weeks.

@steevanb
Copy link
Copy Markdown
Contributor Author

steevanb commented Oct 7, 2021

Great news, finally the 1.0!

Thanks for this awesome tool!

@ondrejmirtes
Copy link
Copy Markdown
Member

You're welcome :)

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.

2 participants