Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed stub types for SplFixedArray #587

Merged
merged 2 commits into from Jul 23, 2021
Merged

Fixed stub types for SplFixedArray #587

merged 2 commits into from Jul 23, 2021

Conversation

dktapps
Copy link
Contributor

@dktapps dktapps commented Jul 22, 2021

No description provided.

@ondrejmirtes
Copy link
Member

I don't get these changes. They do the exact opposite of what you asked. The offsetGet can never return null because it throws an exception.

@dktapps
Copy link
Contributor Author

dktapps commented Jul 23, 2021

I'm not sure how you drew that from my issue, but this is in fact the correct behaviour. SplFixedArray will return null for offsets that exist but aren't yet initialized. https://3v4l.org/GBc56

@ondrejmirtes
Copy link
Member

Oh thanks, I tested if for an offset that was outside the length bound and it thrown an exception instead.

@ondrejmirtes ondrejmirtes merged commit cacc8bb into phpstan:master Jul 23, 2021
@ondrejmirtes
Copy link
Member

Thank you.

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