The comparison using switch is loose, i.e. does not compare types. See http://www.php.net/manual/en/control-structures.switch.php