Markus Staab

Results 1115 comments of Markus Staab
trafficstars

A similar thing was implemented for a different rule in https://github.com/phpstan/phpstan-src/pull/3662 - which might be useful as inspiration for a fix

There is even a blog post about this topic in case you are interested in the bigger picture https://staabm.github.io/2024/11/28/phpstan-php-version-in-scope.html

I tried reproducing slowness on my laptop and all I got was 0,5-1s analysis. > [phpstan.org/r/18cfde16-87f2-4671-92af-0dbbb1e176ce](https://phpstan.org/r/18cfde16-87f2-4671-92af-0dbbb1e176ce) > > Uncomment the foreach loop and it will just time out in the...

phpstan recently also added https://github.com/hoaproject/Regex which is a AST for regex. just in case this would make more sense for you because of additional use-cases.

> Instead of parsing to detect errors, it might be nice to parse for capture groups. > That way you can improve the types for e.g. `preg_match`. I implemented this...

I am wondering why the dataprovider statistics contain so much more invocations for this calls: ``` 1,05 0,023224 0 37209 2418 close 1,03 0,022801 1 21321 6648 openat 0,84 0,018625...

I am not entirely sure whether I am reading the implementation correctly, but it looks like we are running grep over the source file for every test over and over...

You could as a POC just hardcode the dataprovider name (instead of the grep) and run the benchmark to compare how much time the grep alone is taking and whether...

> Note: I'd only merge after a green 8.4 CI run I ran it locally successfully against 8.4. :) need to have a look where/how to make CI run on...