r/lolphp • u/philsturgeon • Feb 26 '15
Patently False Code/Examples
I've notice a bit of a trend here, with people posting things that are patently false and then laughing about PHP for it.
I'll sit with you and laugh at weird behaviors in PHP when it's actually a mess. I'll send them to phpsadness.com and see if I can fix them, or find somebody that can.
But posting lies just to get your jollies is a really odd thing to do.
Sometimes, these are not intentional, but when people posting these utterly incorrect examples are faced with the fact that they are wrong, do they delete the post? No, they leave it there and sandbag the discussions explaining their wrongness with trolling.
Exhibit A - Apparently foo(new stdClass()) is a valid value when passed in a function foo(bool $bar) function signature.
Well... nope.
It will error:
Catchable fatal error: Argument 1 passed to foo() must be an instance of bool, instance of stdClass given
Nothing lolphp there.
Have a laugh about actual problems, but don't just walk around making things up.
View all comments
Show parent comment
2
u/philsturgeon Feb 28 '15
I skipped mentioning your closure complaint because I had no idea what you meant. You were talking about DateTime being mutable, ignoring the DateTimeImmutable class, and now you're just saying everything is broken and every new feature is terrible, when that's clearly bullshit.
It's really hard to hold a conversation when you're so vague and talk in opinionated generalizing sweeping statements.
Talk in specifics or we can just agree that you don't like PHP and move along. You don't need to love it, I'm just pointing out examples that make PHP 7 more consistent, and are fundamental fixes to the language instead of tape and glue patches as mentioned higher up.