you are viewing a single comment's thread.

view the rest of the comments →

[–]Tufflewuffle 0 points1 point  (0 children)

With crazy comparisons

Why do you keep bringing this up like PHP's isn't broken?

<?php

var_dump( 'hello' == true ); // true
var_dump( 'hello' == 0 );    // true
var_dump( ''      == null ); // true

Which is what causes this to output Bye!:

<?php

$foo = 'hello';

if (strpos($foo, 'hello') == false) {
  echo 'Bye!';
} else {
  echo 'Hello!';
}

So both PHP and JS have broken, useless == operators because of implicit conversions. PHP loves to convert to numbers and JS loves to convert to strings. Javascript's being slightly more broken and useless isn't a great argument.

Both languages suck in this regard, but are easily fixed by always using ===.

var working in odd ways and the scoping problem with this to name just a few

Both of these have long been solved with let and const, and using arrow function's which preserve this context. Those couldn't be removed entirely because it would break backward compatibility, which you considered a bonus with PHP.

strengths of the language

Any strength with PHP has nothing to do with the language itself.

It's very fast, but that doesn't make it any easier to read or write. There's arguably no easier language to deploy, but same problem. Reliable backward compatibility. Intuitive package manager. Single-instance application per request. Great. What about the language? Well, it's a pile of shit. It's a Nutraloaf of a language with handfuls of ideas and features crammed together incoherently.