You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$rollback_tr = false;
$result = $function($rollback_tr); // $function takes an argument by reference
if ($rollback_tr) {
Expected output:
No errors
Output:
If condition is always false.
The text was updated successfully, but these errors were encountered:
phrounz
changed the title
False positive "If condition is always false." when using function variable
False positive "If condition is always false." when using variable function
Jun 6, 2019
@@ @@-10: If condition is always false.+10: If condition is always false.+16: Function myFunction() has no return typehint specified.+16: Function myFunction() has parameter $rollback_tr with no typehint specified.
Full report
Line
Error
10
Function myFunction() has parameter $rollback_tr with no typehint specified.
16
Function myFunction() has parameter $rollback_tr with no typehint specified.
16
Function myFunction() has parameter $rollback_tr with no typehint specified.
@@ @@-10: If condition is always false.+16: Function myFunction() has no return typehint specified.+16: Function myFunction() has parameter $rollback_tr with no typehint specified.
Full report
Line
Error
16
Function myFunction() has no return typehint specified.
16
Function myFunction() has parameter $rollback_tr with no typehint specified.
Version used: PHPStan 0.11.8
Offending code
More precisely, the following piece of code:
Expected output:
No errors
Output:
If condition is always false.
The text was updated successfully, but these errors were encountered: