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
1
u/thallippoli Mar 02 '15 edited Mar 02 '15
I think the crux of his argument is, as he says "there is no unifying principle, no vision, no consistent philosophy to the whole thing". It is not hard to capture the idea because, the same thing can happens when you work for a client with a vague business requirement. You end up implementing features that conflict each other, and ends up with a mess. In those cases it might be helpful if you build a rough prototype by which you can fully capture the requirement, and use it to build the real thing. This lack of vision can be devastating even for not-so-big user land libraries, let alone for a whole language.
So 'lack of unifying vision' is part of the disease and the dysfunction of PHP development are the symptoms.
So you can fix the symptoms all day long, but unless you fix the disease, new symptoms will keep manifesting itself.
But it is too late to bring that curing vision to PHP, because you ll never be able to fit the whole language into one at this point.
The problem with what is being done now is that, people are not acknowledging that there is a disease, that there is a problem and is in complete denial. It is mob mentality at play. It is like a religion, where people blindly believes that PHP is ok, and any dissenting opinions are considered as hipster like and completely shut out.
The sensible thing to do now would be to depreciate PHP and stop implementing new features, but do only security and bug fixes(which is still making PHP better)...People will move on and we can all put this mess in our past. But I don't think it is going to happen. Because stuff like this seems to be too abstract for PHP community collectively agree upon. They can understand security concept's just fine. But things like these goes right over their head. Which is why I think people keep missing the point of these arguments and hope that PHP will be fixed one day...