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
Up to PHP 8.0, substr used to return empty string on failure. Since PHP 8.0, it returns false. We have a function (coming in #602) which can handle both of the 2 different cases.
Currently we don't check our substr for failures at all. Eg: $diff_txt = file_get_contents(substr($screenshot, 0, -4) . '.diff.txt');
will evaluate to: $diff_txt = file_get_contents('false.diff.txt');
on PHP 8.0 failure and to $diff_txt = file_get_contents('.diff.txt');
on failure on versions before 8.0.
The compatibility function forces us to check if we had a failure or not.
The error was found by PHPStan but it doesn't complain about it anymore as it thinks we want to have false.diff.txt etc.
The text was updated successfully, but these errors were encountered:
Describe the bug
Up to PHP 8.0,
substr
used to return empty string on failure. Since PHP 8.0, it returnsfalse
. We have a function (coming in #602) which can handle both of the 2 different cases.Currently we don't check our substr for failures at all. Eg:
$diff_txt = file_get_contents(substr($screenshot, 0, -4) . '.diff.txt');
will evaluate to:
$diff_txt = file_get_contents('false.diff.txt');
on PHP 8.0 failure and to
$diff_txt = file_get_contents('.diff.txt');
on failure on versions before 8.0.
The compatibility function forces us to check if we had a failure or not.
The error was found by PHPStan but it doesn't complain about it anymore as it thinks we want to have
false.diff.txt
etc.The text was updated successfully, but these errors were encountered: