Things for which I trully hate PHP and its creators

PHP is the most popular programming language for development of webpages and web services. With addition of a good framework it can even produce a professional results. However, this does not change the fact, that it is also the most shitty programming language in the world, full of garbage and with number of stupidities beyond imagination. And professional programming (without a good framework) is impossible.

Even though this is a language of my choice (only after cleaning it from all the shit, by using a good framework), I decided to write this article, where I'm pointing out most annoying and stupid things, I ever found in PHP.

Notice, that I'm not talking here about things that some may see as wrong, while other will see as good. For example, I'm not talking about types auto-declaration and auto-change, which ones (mostly newbies) takes as ease of coding and others (mostly profs) as source of mess.

I'm talking here only about pure madness, confirmed piece of shit and horrible pain in the ass, this language is.

Please, take also into consideration that this text was written under strong emotional influence and thus it (intentionally!) contains a lot of harsh language and words or phrases that some readers may not accept.

Unbelievable mess in functions names

For example -- string operation functions, which names are divided into three groups:

  • beginning with str_, like str_pad(),
  • beginning with str, like strstr(),
  • not beginning with str at all, but still related to strings manipulation, like ucfirst().

Or another example -- all array-manipulating functions names start with "array_", right? Wrong!

All, except sorting ones, like: arsort(), asort(), ksort(), krsort(), rsort(), sort() and usort().

Only a small bunch of morons behind PHP knows, what is a reason for separating those and not naming them with "array_" beginning. And only those idiots see reasons for shorting names to u*, k*, r*, kr* and similar shit, instead of naming them like array_user_sort() (or at least user_sort()) or array_key_revesed_sort() (or at least key_reversed_sort()) and so on.

Too long names? Then what about date_interval_create_from_date_string() mentioned below?

Even more mess...

The very same group of array-sorting functions is also a bit different example of unnecessary mess made in PHP. Six different functions, where you could use one! Simple sort() with additional parameters like reverseOrder, maintainAssociations or byKey.

But, that is not an end in PHP! Language creators made really a good stuff of making it as shit-full as possible. Commas are allowed even after last element of an array, lines of code can end with semicolon or without it and many many more.

All this stuff has one, single purpose, that never changed from the very beginning of PHP existence. To allow morons to code!

Instead of educating programmers, forcing them to learn, pushing their knowledge to higher levels by forcing certain clarity in language, all that was done for all these years so far, is an introduction of more and more mess to allow / help more and more stupid people code.

You don't get that colon is a separator of an array items and thus it is not allowed after the last element? No problem! We'll change language parser to accept it. You are too stupid to understand, that each and every line must end with a semicolon? Fear not! We'll handle this as usual.

And all of this to allow morons to code, instead of educating them.

Backward compatibility? Screw you! Code changes, you know? And so does the developers. Or at least, they should. If some morons are refusing to learn something new (like object-oriented programming -- see below) then simply let them stay on older version. Force them to upgrade both their PHPs and their brains, if they want new versions. Instead of flooding language with an unbelievable amount of shit and punishing others.

Damn procedural-style of coding

PHP is still supporting procedural-style of coding! Even though PHP 6 is near-by and we're like nearly twelve years into twenty first century!

And no, I don't mean doing revolution, like: starting from this version we're throwing all the str, str_ and "no-str" crap into hell, changing everything to operate on String object only, etc.

I'm talking about situations like with DateTime class, introduced just a few years ago (when object-oriented coding was de facto standard and confirmed as the only way of professional coding). It was immediately supported by a bunch of shit-head procedures like date_date_set(), an incarnation of pure idiocy called date_interval_create_from_date_string() and similar crap!

Why? For what reason? Who needs it? Without this messy shit at least half of procedural-way coders would have to at least start thinking about learning object-oriented programming. But, why? If morons behind PHP decided that every new object will be followed by bunch of useless procedures for lazy idiots.

Morons at the gates

Here goes an example of morons developing PHP refusing to change even obvious mistakes.

Let's take implode() function as an example. Here is its declaration:

string implode(string $glue, array $pieces)

Only a complete moron could design function in the way that $glue parameter (which is not required) is first! It has to be second, because this is a nature of parameters that can be omitted (required parameters are first and optional ones last, to not create stupid gaps with using NULL values etc.).

What is explanation for this?

For consistency with explode().

Only two lines below, in $glue parameter definition PHP-morons finally understood, how big shit they designed. And so they wrote:

Defaults to an empty string. This is not the preferred usage of implode() as glue would be the second parameter and thus, the bad prototype would be used.

Yet, they still hadn't got enough intelligence to fix this.

Functions trying to be more clever than developers

For example, again, array_unshift(), array_merge() and many other operating on arrays.

Only badly mentally-ill brain can understand, what is the reason for this function to rearrange keys order?

Before:

Array
(
    [2] => LAB
    [1] => HALL P.
)

After:

Array
(
    [0] => [none]
    [1] => LAB
    [2] => HALL P.
)

(for blind or dumb: LAB has key 2 before array_unshift() and 1 after it!)

This makes most associative arrays useless after being treated with this or similar function.

You can try to avoid this, by using:

$arrayName[0] = 'value to be inserted';

instead of using array_unshift().

And, if you need to insert value at the beginning, but you don't know, if key = 0 isn't occupied and if you can use it? Well... stick your finger into your ass and shout loudly seven times "PHP creators are complete morons!". Only then you'll be enlighten by a solution...

The Oracle hell

People responsible for PHP development are not only stupid like a hell, but they are also hellishly lazy!

You can't use other words to name situation, in which bugs are kept unfixed for years, even if they are crucial and fundamental for most basic functionality (database accesss!) and even if all, that is needed to fix them is to change, single line of code and recompile sources!

My beloved one. PHP PDO Oracle driver!

Say, that you have a webpage encoded in UTF-8 and thus your forms data ships to database encoded this way. Say, that your database itself uses different encoding. Oracle itself can handle such situation without any problems (doing on-the-fly encoding conversion). PHP dies on this completely!

To be honest, it dies on every Oracle database request, where data is encoded in UTF-8 (two bytes per char), even if database is also encoded in UTF-8.

This is, because morons from PHP assumed that data stored in Oracle always will be one byte per char!

At first, I found this bug and realized, that one day after reporting it someone has close it, claiming that this bug was fixed in next nightly build.

If fact, it wasn't! Either:

  • PHP developers are fools and saying, that they done something, while the done nothing or
  • PHP developers are fools and they doing changes in source code without even testing, what they're committing.

Either way -- people doing so should be shoot down and eliminated from healthy society.

But, only now here comes the best.

Above mentioned bug not only wasn't fixed in next nightly build. It isn't fixed up until now (after seven years). These extreme morons hasn't even reopened this bug, though many people (including me) provided comments that this bug is still not fixed.

But, the story does not end in that point. After some time, I found this bug and got really pissed-off.

It turned out, that someone has provided morons at PHP dev team, with a ready-to-be used fix-up of above mentioned bug and a complete description of what should be done. And even it these idiots must change a single line in one file and recompile sources, they -- again -- hasn't done this for years!

The situation is like this. A quite large of PHP and Oracle users cannot use this tandem at all, because PHP fails of any Oracle request encoded in UTF-8. People are trying to use modern (the only, de facto) way of encoding strings, but are blocked by stupid bug in PHP. To fix this bug, all it is needed to be done, is to change one line. And still, nothing is done for years.

Understanding above was a spark that ignited fire and caused me to write this article.

Conlusion

PHP is most shit-full programming language that world has ever seen. It is very easy to use and very popular in the same time (available in nearly every hosting) and thus used by many, many people, which should never touch programming or keyboard itself.

Instead of using this popularity to educate these people, to force them learning new coding standards, morons behind PHP development decided to fill their language with even bigger shit.

With use of a good framework) programming in PHP is nice and easy and can lead to producing really professional solutions. Without it, coding in pure PHP is a nightmare that can lead to producing ill-fated dramas (sometimes called websites), full of bugs and security breaches.

Leave a Reply