We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The result of incrementing a string is not necessarily a string.
function inc(string $n): string { $before = $n; $after = ++$n; assertType('array{string|int, string, string|int}', [$n, $before, $after])); return (string)$after; // No warnings expected here } inc('10'); // => '11' inc('a'); // => 'b'
This behavior is consistent between PHP 8.3 and earlier: https://3v4l.org/i4rru
There seems to be a problem with InitializerExprTypeResolver::getPlusType().
InitializerExprTypeResolver::getPlusType()
https://phpstan.org/r/110b3926-f4c5-4f51-b4ab-537fa2be3fb6
No errors.
I'm excited to see that PHPStan is working consistently even with PHP 8.3.
The text was updated successfully, but these errors were encountered:
Fixed phpstan/phpstan-src#2797
Sorry, something went wrong.
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.
No branches or pull requests
Bug report
The result of incrementing a string is not necessarily a string.
This behavior is consistent between PHP 8.3 and earlier: https://3v4l.org/i4rru
There seems to be a problem with
InitializerExprTypeResolver::getPlusType()
.Code snippet that reproduces the problem
https://phpstan.org/r/110b3926-f4c5-4f51-b4ab-537fa2be3fb6
Expected output
No errors.
Did PHPStan help you today? Did it make you happy in any way?
I'm excited to see that PHPStan is working consistently even with PHP 8.3.
The text was updated successfully, but these errors were encountered: