- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
if ($template) // BAD
if (isset($template)) // GOOD
if ($template !== NULL)) // GOOD
if ($template !== '')) // GOOD
if (strlen($template) > 0) // BAD! strlen("-1") is greater than 0
if (is_string($template) && strlen($template) > 0) // BETTER
if ($foo == $bar) // BAD, avoid truthy comparisons
if ($foo != $bar) // BAD, avoid falsy comparisons
if ($foo === $bar)) // GOOD
if ($foo !== $bar)) // GOOD
// We only allow valid persons
if (is_object($p) && strlen($p->lastN) > 0 && $p->hidden === FALSE && $this->environment->moonPhase === MOON_LIB::CRESCENT) {
$xmM = $thd;
}
if ($this->isValidPerson($person) {
$xmM = $thd;
}
Follow us!