The expression $maxLength of type integer|null is loosely compared to true; this is ambiguous if the integer can be 0. You might want to explicitly use !== null instead.
In PHP, under loose comparison (like ==, or !=, or switch conditions),
values of different types might be equal.
For integer values, zero is a special case, in particular the following
results might be unexpected:
0==false// true0==null// true123==false// false123==null// false// It is often better to use strict comparison0===false// false0===null// false
Loading history...
47
$string = substr($string, 0, $maxLength);
48
}
49
50
return $string;
51
}
52
53
/**
54
* {@inheritDoc}
55
*/
56
public function check($password, $hash)
57
{
58
$out = false;
59
// compare to includes/functions.inc.php is_pw_correct() mlf 2.3
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
integer
values, zero is a special case, in particular the following results might be unexpected: