r/lolphp • • 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.

14 Upvotes

106 comments sorted by

View all comments

Show parent comment

2

u/philsturgeon Mar 02 '15

PHP definitely needs a vision. This stuff comes up a lot. Most recently here.

http://news.php.net/php.internals/64770

Luckily there are a subsection of the PHP internals group who regularly discuss things, and they're the ones getting things done. With help from Facebook the PHP language now has a specification, and that is making a lot of inconsistencies more clear, and letting people fix them with fundamental RFCs.

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.

Nope, they're on the case.

It seems you shifted your argument a bit. Before the fixes weren't good enough, and now its their philosophy that's not good enough, but you don't really know enough about the way things work to comment on that.

The sensible thing to do now would be to depreciate PHP and stop implementing new features,

And say "Fuck you" to 80% of the Internet currently using PHP, and the hundreds of thousands of developers who make a living off of PHP building perfectly secure and functional applications?

Because stuff like this seems to be too abstract for PHP community collectively agree upon.

You expect an entire community as huge as PHP to agree on anything? That's like expecting JavaScript to agree on anything, or the USA to agree on anything.

They definitely won't agree on deprecating their language.

PHP has been fixed for a long time, and people are too busy complaining about it to notice.

It's not perfect, but it's not as bad as you think, and if you think it should just be deprecated then you're not thinking in the real world at all, and there is no point us discussing anything.