-
-
Notifications
You must be signed in to change notification settings - Fork 863
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
net_get_interfaces() function and bleading edge #9535
Comments
Something about the name offset is off: https://phpstan.org/r/fde60006-e4fd-47c6-ac64-193c9e2d01a6 |
simplified repro: https://phpstan.org/r/78e22dfe-8656-40f0-8a7b-044bc9f37eb1 an earlier assertion might be helpful as any type with |
The reason (higher level than 6): https://phpstan.org/r/7dff3f5f-d99f-49bc-a5e4-4c19383f688a Of course the behaviour could be improved. |
@mvorisek After the latest push in 1.11.x, PHPStan now reports different result with your code snippet: @@ @@
-PHP 8.0 – 8.3 (2 errors)
+PHP 7.3 – 8.3
==========
-23: Parameter #1 $array of function uasort contains unresolvable type.
-23: Parameter #2 $callback of function uasort contains unresolvable type.
-
-PHP 7.3 – 7.4 (2 errors)
-==========
-
-23: Parameter #1 $array_arg of function uasort contains unresolvable type.
-23: Parameter #2 $callback of function uasort contains unresolvable type.
+No errors
PHP 7.2 (3 errors)
========== Full reportPHP 7.3 – 8.3No errors PHP 7.2 (3 errors)
|
@ondrejmirtes After the latest push in 1.11.x, PHPStan now reports different result with your code snippet: @@ @@
-PHP 8.0 – 8.3 (3 errors)
+PHP 7.3 – 8.3 (1 error)
==========
-24: Dumped type: list<array{name: *ERROR*, ip: mixed~null, mask: mixed~null, family: mixed~null}>
-25: Parameter #1 $array of function uasort contains unresolvable type.
-25: Parameter #2 $callback of function uasort contains unresolvable type.
-
-PHP 7.3 – 7.4 (3 errors)
-==========
-
-24: Dumped type: list<array{name: *ERROR*, ip: mixed~null, mask: mixed~null, family: mixed~null}>
-25: Parameter #1 $array_arg of function uasort contains unresolvable type.
-25: Parameter #2 $callback of function uasort contains unresolvable type.
+24: Dumped type: list<array{name: (int|string), ip: mixed~null, mask: mixed~null, family: mixed~null}>
PHP 7.2 (4 errors)
========== Full reportPHP 7.3 – 8.3 (1 error)
PHP 7.2 (4 errors)
|
@mvorisek After the latest push in 1.11.x, PHPStan now reports different result with your code snippet: @@ @@
PHP 7.3 – 8.3 (1 error)
==========
-4: Dumped type: *ERROR*
+4: Dumped type: (int|string)
PHP 7.2 (2 errors)
========== Full reportPHP 7.3 – 8.3 (1 error)
PHP 7.2 (2 errors)
|
@ondrejmirtes After the latest push in 1.11.x, PHPStan now reports different result with your code snippet: @@ @@
==========
3: Argument of an invalid type array|false supplied for foreach, only iterables are supported.
-4: Dumped type: *ERROR*
+4: Dumped type: (int|string)
PHP 7.2 (2 errors)
========== Full reportPHP 7.3 – 8.3 (2 errors)
PHP 7.2 (2 errors)
|
Fixed: phpstan/phpstan-src@cb5a2b4 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug report
Present only with a bleading edge enabled. I do not fully understand what phpstan tries to tell here and I belive there should be no error.
Code snippet that reproduces the problem
https://phpstan.org/r/66728891-b329-4df3-ab1c-c49238e10308
Expected output
no error
The text was updated successfully, but these errors were encountered: