44
oroys
8y

Discovered this beauty of code in an old application at work

Comments
  • 2
    It's more descriptive than

    (!empty ($var)) + ""

    If you really need strings
  • 4
    @ChappIO you should never need strings for booleans. If you do something is inherently wrong with your code.
  • 0
    @Nexion Unless you're using libraries that expect strings.

    Logging frameworks, reflections based graphing libraries, localization libraries
Add Comment