What's so bad about PHP?

What's so bad about PHP?

that python exists

It was developed by cis white males.

It's not hipster enough.

The programmers.

But the inventor of it is a fucking white male

There's just so much.

The type system is completely broken. Take some arbitrary values and > < and == them, and see what happens.

The standard library usually (poorly) wraps C functions (return variable function parameters in a scripting language?), and if they find that one of their implementations is broken (mysql_escape_string), they don't just fix it, they add another implementation (mysql_real_escape_string).

The lexer is garbage. Not only does it transform literals into whatever type it seems fit, it also doesn't even build an AST.

pls stop oppressing me

Sup Forums said it sucks, and that's enough for me.

> The type system is completely broken. Take some arbitrary values and > < and == them, and see what happens.

Huh, well that seems like a pretty significant problem, not really looking forward to working with it in the future.

>mysql_real_escape_string

this is the kind of shit that makes me kek about php.

they fucking take backwards compat WAAAAAAAAAAAAAAY to seriously.

Nothing really. It is yet another scripting language that makes accessing a database for web display / updating easy for everyone.

they break backwards compatibility in the mysterious ways their type system and lexer behaves all the time by accident, and their test suite is fucking broken last I checked as well, so they're just fucking incompetent at it and try to overcompensate.

Oh yeah did I also mention that they managed to balls up their implementation of the Mersenne Twister PRNG? You know, the one with the widely available reference implementation released under a very liberal license?
And they don't want to fix it for backwards compatibility, just in case somebody depends on the non-randomness of an RNG.

6

Typing is meh. For a language that feign dynamism, having a string concatenation operator that causes compiler errors is a nuisance.

I also feel like so much of it pigeonholes itself into using associative arrays with dimensions that make it seem like you're writing some tensor nonsense.

Horrible default functionality that turns your webapp into swiss cheese security-wise. Incredibly lax error handling. In general, where other programming languages would report programmer error, PHP does the least sensible thing then continues on as if nothing happened. Very odd default function names selected entirely to optimize a shitty choice of hashtable implementation. Everything is inconsistent as all hell.

Only reason to program in PHP is because halfway decent CMS platforms use it. Other than that, literally anything is better - yes I'm including both Rails and node.js in this.

This is the reason why I actually love PHP. No need for casting shit. If you want to do something quick and dirty, this is awesome. Not trolling.

>In general, where other programming languages would report programmer error, PHP does the least sensible thing then continues on as if nothing happened.

Error reporting should be on by default. If not, you have to set the option.

There is no central philosophy as to how things should work in PHP.

Every part of the language does the similar task differently because they were designed by different people at different times in ad-hoc fashion with no central planning.

On top of that, weird mish-mash of poorly-wrapped around C libraries mean idiosyncracies of these libraries' designs also plague PHP.

This. I wouldn't use it for real projects, but for prototyping small shit? Hell yeah, easy as fuck.

Nothing, spergs here are too dumb to domain it properly

It has a bad rap because it's incredibly easy to use, which means there are a lot of people that have no clue what they're doing using it.

Personally, I like it. It's available anywhere and has a lower barrier for support than other niche shit like node.

It's not Haskell

> It has a bad rap because it's incredibly easy to use

No, it has a bad rap because it's poorly designed. Var prefixes, first class functions via passing strings, even within core libraries they can't figure out a consistent naming convention, and a really poorly bolted-on class system all combine to make it actively hostile to people trying to write code at scale.

> other niche shit like node
m8, I don't have any particular love for node but calling it niche in 2016 makes you sound like a hick.

This

Literally the smartest programming language. Not PHP's fault these faggots can't figure out how to add 3 and 3

...

>I throw things together till it works...
Programming 101

All the shit you listed is only a problem if you're inexperienced with PHP. And talking about writing code at scale, Facebook utilizes PHP in some parts. It's not a problem and applications far larger than anything you will ever use build with it.

>but calling it niche in 2016 makes you sound like a hick
There isn't a single enterprise application that runs on node. You don't see it anywhere except in hipster shit. It's niche.

>All the shit you listed is only a problem if you're inexperienced with PHP
Wrong. With enough experience with brainfuck you can work around it but that doesn't make it a good language. There's a difference between a steep learning curve and shit design you can learn to live with.

> Facebook utilizes PHP in some parts
So what? Does facebook uses node as well, is that an endorsement of javascript? Does that mean there are no design issues in that language?

>There isn't a single enterprise application that runs on node
What the hell is your definition of enterprise? Again, facebook uses node, as do netflix and paypal. Mind these are all polyglot shops but then most large companies are. It's not even close to niche.

Using a programming language of a guy who couldn't think of a hash function and rather fucked up the naming of his whole standard library...

Yeah enjoy your
>string_copy
>scpy
>str_cpy
>str_copy
>str_cpyiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
>_s_t_r_c_o_p_y_
you dumb sheeple

>it also doesn't even build an AST.
Holy crap it didn't know that.

>What's so bad about PHP?

Sup Forums telling you it's bad but the site is built on PHP Just stop wasting time and go program.