Review main Abandoned

28017[CLEANUP] Replace strlen() with === for zero length check

Michiel Roos CR 0 V 0 Hard +350 −331 updated 03/04/14, 09:11

Commit message

It is faster to compare a string with === '' to find out if it's empty
than to run strlen() on it.
The replacement rules are applied as follows:
 *    if (strlen($str))
   => if ((string)$str !== '')
 *    if (!is_string($str) || strlen($str) === 0)
   => if (!is_string($str) || $str === '')
 * If it can be seen easily that $str is a string,
   the typecast is omitted.

Review

  • Code review CR 0

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V 0

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 115

Show 95 more files