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

Crash: Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end) #11026

Closed
fredericgboutin-yapla opened this issue May 14, 2024 · 1 comment

Comments

@fredericgboutin-yapla
Copy link

fredericgboutin-yapla commented May 14, 2024

Bug report

phpstan crashes on this,

<?php 

range(1, 3/2);

Internal error: range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end) Run PHPStan with --debug option and post the stack trace to: https://github.com/phpstan/phpstan/issues/new?template=Bug_report.yaml

A @phpstan-ignore-line won't work and I must exclude the file altogether.

Code snippet that reproduces the problem

See https://phpstan.org/r/bd8bdb89-b617-4dd3-a18d-80a20aa92f07

Expected output

Not to crash and probably tell me that it doesn't make sense that then end value is lower than the start value, when applicable.

Did PHPStan help you today? Did it make you happy in any way?

No response

@ondrejmirtes
Copy link
Member

Fixed phpstan/phpstan-src@fe3895a

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

No branches or pull requests

2 participants