I’m vocal about how PHP sucks. I make no bones about it, and try to hasten the company’s move to better languages. Occasionally I’m challenged on this. I submit for your approval the following code:
if (empty(trim($string)))
This will exert a Fatal Error every single time. With a horrible message: “Can’t use function return value in write context.”
WTF?
Sympathizers: I know what you’re about to say. empty() is a language construct that specifically looks at a variable. You just have to assign the trim() result back to a variable first for this to work. If you’d read the manual entry for empty() you’d know that!
Fuck that noise. I don’t care if it’s well documented. I don’t care that technically speaking the empty() construct can only check variables. It does not matter. This is shit behavior.
Sympathizers: grow some balls backbone. PHP sucks. It’s okay to admit it. Yeah, it has some redeeming value, else we wouldn’t be discussing it now. But you’re letting the PHP developers get away with murder here.
PHP Core Developers: Yes, the language you write powers a metric shit-ton of awesome businesses, Innvoa included. That doesn’t give you a free pass to do fucking idiotic things like this. Fix it!

Leave your mark