Using empty() in PHP

Here’s a gotcha I did not know existed: PHP’s empty before version 5.5 only works on variables. If you try to pass in an expression, it will fail hard (like HTTP 500 hard).

Refs: http://stackoverflow.com/q/1075534