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
There are a couple of reasons why I believe the sniff is correctly throwing an error, but I am open to suggestions on how to improve the sniff further.
Whether it is a problematic change depends on whether or not strict_types is enabled.
If it is, this change will cause a fatal TypeError: https://3v4l.org/o8mcK
If it is not, then the non-strict-type type juggling for scalar values will silently "auto-mitigate" the change, but that doesn't take anything away from the fact that the wrong parameter type was passed.
Maybe it should be a warning if the file doesn't declare strict_types and an error when it does ?
Note: the same applies to the sem_get() function, which this sniff also handles.
I tried to use an int with ob_implicit_flush, and it did not cause an error in any version (3v4l):
ob_implicit_flush(1);
However, the sniff marks it as an error:
PHPCompatibility/PHPCompatibility/Sniffs/ParameterValues/ChangedIntToBoolParamTypeSniff.php
Line 121 in 43caf02
If the change is not backwards-incompatible in practice, should we highlight this as an error?
The text was updated successfully, but these errors were encountered: