-
-
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
False positive with try-catch #1597
Comments
This looks like it is fixed https://phpstan.org/r/38dd3f24-0b99-445e-b6ec-8162fe1950ea |
This cannot fully work until exception tracking is implemented.
On Sat, 13 Jul 2019 at 10:38, Adam Žurek ***@***.***> wrote:
This looks like it is fixed
https://phpstan.org/r/38dd3f24-0b99-445e-b6ec-8162fe1950ea
but I don't get why your Expected output is NO ERROR... there is error,
see https://3v4l.org/4ooeP
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1597?email_source=notifications&email_token=AAAZTOCE3GDRBFWVPPHEI5DP7GIBFA5CNFSM4GC2BOXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ3M7TQ#issuecomment-511102926>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAZTOC7JYDNPNEPTEGZBFLP7GIBFANCNFSM4GC2BOXA>
.
--
Ondřej Mirtes
|
@adaamz PHPStan now reports different result with your code snippet: @@ @@
-9: Parameter #1 $unixtimestamp of method DateTime::setTimestamp() expects int, string given.
+8: Call to function is_numeric() with ''|DateTime will always evaluate to false. Full report
|
@adaamz After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-9: Parameter #1 $unixtimestamp of method DateTime::setTimestamp() expects int, string given.
+8: Call to function is_numeric() with '' will always evaluate to false. Full report
|
I think the result is correct now. Thank you @ondrejmirtes! I'll leave it open for now in case you want to add a regression test but feel free to close it if not. |
Fixed by: phpstan/phpstan-src#481 I'll add the regression test later in a batch. |
Closes phpstan/phpstan#1597 Closes phpstan/phpstan#3617 Closes phpstan/phpstan#778 Closes phpstan/phpstan#2969 Closes phpstan/phpstan#3004 Closes phpstan/phpstan#3710 Closes phpstan/phpstan#3822 Closes phpstan/phpstan#505 Closes phpstan/phpstan#1670 Closes phpstan/phpstan#1219
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. |
Summary of a problem or a feature request
PHPStan assumes that
$date
will be\DateTime
instance in the catch block which may not be true.Code snippet that reproduces the problem
https://phpstan.org/r/16f4221ff88c24829994a285304c13f8
Expected output
no error
The text was updated successfully, but these errors were encountered: