The expression $count of type integer|null is loosely compared to true; this is ambiguous if the integer can be zero. 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...
37
$body = Middleware::createStream();
38
$body->write($html);
39
40
return $response->withBody($body);
41
}
42
43
return $response;
44
}
45
46
/**
47
* Check whether the request is post (or any similar method).
48
*
49
* @param RequestInterface $request
50
*
51
* @return bool
52
*/
53
protected function isPost(RequestInterface $request)
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: