You're thinking of == which type coerces the non-empty string to boolean true.
PHP is not the only language that has this type of behavior.