Replies: 2 comments 4 replies
-
|
it does, the docblock is fine, right? but I think PHPStan does not understand that explode with the limit could return a constant array. I see this as improvement request for |
Beta Was this translation helpful? Give feedback.
-
|
The only type-safe variant of your code is: https://phpstan.org/r/547f00a8-f5bc-4326-86c5-3e4a23da19ce (so PHPStan already understands it well). From the PHP manual (https://www.php.net/manual/en/function.explode.php):
So it's not the exact number, it's maximum number. For bigger numbers in Which I don't want to do to compromise performance. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
https://phpstan.org/r/fde33ebc-dc66-4a14-b5ed-0adf18aab628
I would expect PHPstan to validate the docblock.
Beta Was this translation helpful? Give feedback.
All reactions