Live data from Hacker News

Benchmarks of PHP 7.2 Beta: PHP Is Still Getting Faster

phoronix.com

31–40 of 144 posts

Re: Benchmarks of PHP 7.2 Beta: PHP Is Still Getting Faster

#31
post #15

Earlier quoted context omitted.

There's one thing none of those have that PHP has: Work with off-the-shelf managed hosting.

This is something programmers will never appreciate, and every small business on earth has already encountered Go build your client's new website in go, and then spend 80 hours trying to make it work with their $5/month hosting

You can get it to work with a $5 a month VPS. The issue is more that a VPS requires constant maintenance.

Let's say my friend runs a store. He needs a website. I can:

1. Find a $5 a month shared hiding plan. As it's Shared, they don't let you start servers, so go (as well as python) is out of the picture (unless you run it as a CGI - yuck). You develops the site, sell it to him, and fix on contract. You never have to do another thing for him.

2. Get a $5 a month VPS, spend another $1 a month (or more) on an S3 backup. Ensure said backup works (try it out once in a while). Keep OS up to date.

Which is easier? Which is more maintainable?

Does anyone think that if WordPress was written in Python it would get nearly as much traction?

That's why PHP won the internet (and that VPSs were extremely expensive until a about a decade ago) - servlets where around for a long time but you couldn't run it on a shared server - made it dead on arrival.

Re: Benchmarks of PHP 7.2 Beta: PHP Is Still Getting Faster

#33
post #5
post #4

Earlier quoted context omitted.

PHP7 has improved life when dealing with legacy systems, but I think all in all you're better off not building new stuff in it. There are almost always better tools for the job than PHP, like Django, Rails, Go's net/http, etc. depending on the kind of thing you're writing.

So, framework-vs-language arguments without any kind of explanation why are in huh? Ok, I can dig it. Instead of wearing sneakers you should wear cloggs or flip flops.

[deleted]

Re: Benchmarks of PHP 7.2 Beta: PHP Is Still Getting Faster

#34
post #5
post #4

Earlier quoted context omitted.

PHP7 has improved life when dealing with legacy systems, but I think all in all you're better off not building new stuff in it. There are almost always better tools for the job than PHP, like Django, Rails, Go's net/http, etc. depending on the kind of thing you're writing.

So, framework-vs-language arguments without any kind of explanation why are in huh? Ok, I can dig it. Instead of wearing sneakers you should wear cloggs or flip flops.

If you want more detail on my position, I wrote more here: https://news.ycombinator.com/item?id=14884665

Re: Benchmarks of PHP 7.2 Beta: PHP Is Still Getting Faster

#35

Honest, sincere, question here: How is programming in PHP these days? I haven't used the language since 4.x-5.2 or so. I wrote it off completely when Hack and HHVM came out due to the nuances between it and PHP proper (not to say either is bad, it was just another barrier, and set of choices I didn't care to deal with). I typically write Ruby, Elixir, and some JVM based languages these days. Any new features or langu…

The biggest grievances stem from PHP wanting to please you and convert things from one type to another even when it really, really shouldn't. Adding variadics in 5.6, return and scalar types in PHP 7 tunes down this sort of crazy. Not fully, though. String comparison is still broken -- use strcmp() and be happy. Using anything else is dark and full of terrors. Well, at least it's not transitive https://3v4l.org/goSYX

Further, avoid == completely, pass the strict argument to functions that do comparison like in_array(). You don't want https://3v4l.org/mcpi7 to happen. You want https://3v4l.org/Yo6tI instead.

Your functions in 7.1 finally can typehint for iterable (array or Traversable object) although the array_* functions still only accept arrays. There are nice little libraries papering that over and installing libraries is easier thanks to composer.

PhpStorm gives you a fantastic IDE. The language is still ridiculously easy to deploy thanks to a zero share model.

Basically: most of the landmines can be cordoned off with putting declare(strict_types=1) on top of your files or bridged over by libraries like nikic/iter. A few are left but they are easy to avoid.

Re: Benchmarks of PHP 7.2 Beta: PHP Is Still Getting Faster

#36

it's really astonishing to see PHP still alive and kicking, despite all the backlashes it has received over the years. whatever it is they are doing, they must be doing something right.

Long time PHP dev here. Note: These are my personal observation and opinion.

The usage you see are mostly from people already invested in PHP. However, I'm starting to see fewer new PHP devs. Some of the talented devs I know of have migrated to other "cool" languages. There are fewer PHP jobs than they use to be. I also observed less activity in PHP related subreddits. Its position as the #1 web server language has already been taken over by nodejs, and the remaining chunk eaten by Go, Python, C# (as ms tech goes open-source) and other languages. I dont see PHP going away anytime soon, but I dont see it gaining more users over time.

Re: Benchmarks of PHP 7.2 Beta: PHP Is Still Getting Faster

#37

Honest, sincere, question here: How is programming in PHP these days? I haven't used the language since 4.x-5.2 or so. I wrote it off completely when Hack and HHVM came out due to the nuances between it and PHP proper (not to say either is bad, it was just another barrier, and set of choices I didn't care to deal with). I typically write Ruby, Elixir, and some JVM based languages these days. Any new features or langu…

[deleted]

Re: Benchmarks of PHP 7.2 Beta: PHP Is Still Getting Faster

#38
post #7

Honest, sincere, question here: How is programming in PHP these days? I haven't used the language since 4.x-5.2 or so. I wrote it off completely when Hack and HHVM came out due to the nuances between it and PHP proper (not to say either is bad, it was just another barrier, and set of choices I didn't care to deal with). I typically write Ruby, Elixir, and some JVM based languages these days. Any new features or langu…

i think PHP has the opposite problem of JavaScript - a build-in function library that's too big and very inconsistent. much of http://phpsadness.com/ remains in v7+. i tried to get them to change their long-standing, self-admitted improper ternary associativity [1] or at least deprecate it in v7 but it resulted in a huge bikeshed (despite no one actually encountering code that depended on the wrong behavior which has…

> i tried to get them to change their long-standing, self-admitted improper ternary associativity [1] or at least deprecate it in v7 but it resulted in a huge bikeshed

Oh man. Remember that drama in the internals when trying to remove T_PAAMAYIM_NEKUDOTAYIM ?

Re: Benchmarks of PHP 7.2 Beta: PHP Is Still Getting Faster

#39

it's really astonishing to see PHP still alive and kicking, despite all the backlashes it has received over the years. whatever it is they are doing, they must be doing something right.

Long time PHP dev here. Note: These are my personal observation and opinion. The usage you see are mostly from people already invested in PHP. However, I'm starting to see fewer new PHP devs. Some of the talented devs I know of have migrated to other "cool" languages. There are fewer PHP jobs than they use to be. I also observed less activity in PHP related subreddits. Its position as the #1 web server language has a…

I think that the cheap VPS is the ultimate cause.

15 years ago (when, BTW, Python was already a thing) you _had_ to use PHP, unless you had extra money to spend on a more "scalable" technology (so enterprises, who had money, frequently chose Java). It was a monopoly like JS was/is a monopoly - you want to write code for a browser - you'd better know JS. Now, between AWS and DO, you can with relative ease start up in Go, Node, or Python, and there's no need for PHP.

Re: Benchmarks of PHP 7.2 Beta: PHP Is Still Getting Faster

#40
post #7

Earlier quoted context omitted.

i think PHP has the opposite problem of JavaScript - a build-in function library that's too big and very inconsistent. much of http://phpsadness.com/ remains in v7+. i tried to get them to change their long-standing, self-admitted improper ternary associativity [1] or at least deprecate it in v7 but it resulted in a huge bikeshed (despite no one actually encountering code that depended on the wrong behavior which has…

> i tried to get them to change their long-standing, self-admitted improper ternary associativity [1] or at least deprecate it in v7 but it resulted in a huge bikeshed Oh man. Remember that drama in the internals when trying to remove T_PAAMAYIM_NEKUDOTAYIM ?

For those that (like me) hadn't heard of it: https://philsturgeon.uk/php/2013/09/09/t-paamayim-nekudotayi...
Post reply on HN