Hacker News new | ask | show | jobs
by 734129837261 1670 days ago
A Reddit post from a few years ago explains pretty well why PHP has such a terrible reputation: https://www.reddit.com/r/webdev/comments/5tqoqa/web_devs_wha...

PHP should have chosen to undergo a rebranding a few years ago, if you ask me. The stigma it has to deal with is probably unsurmountable and will be forever. If you think PHP, you think WordPress and Joomla, and that means "hacks and vulnerabilities"...

It's a good language nowadays, with quirks like any other language, but I still have one big problem with it: There are too many "PHP developers" out there, and most of them are very bad, and many of the good ones are from poor regions in the world and you can find them on Fiverr doing kick-ass work for a grand total of $50.

2 comments

My personal favorite PHP wtf is this one:

  if (md5('240610708') == md5('QNKCDZO')) {
    echo "true\n";
  }
Though I do use php, and love many things about it.
Do you know why that is?

  php > echo md5('240610708');
  0e462097431906509019562988736854

  php > echo md5('QNKCDZO');
  0e830400451993494058024219903391
Would this be avoided by using a string comparison function?

https://www.php.net/manual/en/function.strcmp.php

Yes, or you can use ===, which will check the type as well. I am trying to get in the habit of using === everywhere now.
Yes.

  php > echo strcmp(md5('240610708'), md5('QNKCDZO'));
  -4
Having been out of PHP for several years now, I assume that needs a === instead of ==? It's unfortunate that we have the need for a ===, but it's no different that JS in that regard.
The underlying issue is that while md5() thinks it is returning a hex number, if the hex number starts with 0e, php thinks it's 0^<whatever>.
How do you find those kickass ones on Fiverr among a sea of bad ones?
the good ones are not on fiverr ;)
The above comment says: "many of the good ones are from poor regions in the world and you can find them on Fiverr doing kick-ass work for a grand total of $50. "

That's what I'm replying to.