Live data from Hacker News

Benchmarks of PHP 7.2 Beta: PHP Is Still Getting Faster

phoronix.com

41–50 of 144 posts

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

#41
Is there a PHP modding squad in Hacker News? Legitimate, non-offensive anecdotes are getting downvoted in this thread while all positive comments are being upvoted.

I think I've seen such a trend rising in the past few years, but I wasn't sure: every thread covering PHP in some way gathered a crowd that defended "how PHP is much better since 5.x" or referred to PHP being hated by people without any good reason.

And yes. This very comment got downvoted to 0 in less than a minute from its submission.

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

#42
post #4

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…

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.

In addition to PHP itself undergoing a lot of good optimizations a lot of tooling and frameworks have come a long way as well. Composer and most modern frameworks play much nicer in the ecosystem and it is quick and easy to get something up and running which gives access to most of the things you'd need in a webapp. I'm a big fan of Laravel personally but there's plenty of other great options nowadays.

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

#43
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 ?

don't remind me.

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

#44

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…

PHP has some design decisions (e.g. shared nothing architecture) that used to be laughed about - nowadays it's obviously known as a big advantage - PHP can scale linearly with no overhead.

[Edit: read what Slack devs wrote about PHP, their server side is written in PHP https://slack.engineering/taking-php-seriously-cf7a60065329 and beside that Facebook uses PHP/Hack and MySQL as core tech)

The syntax is inspired by Perl and C family (C/C++ and Java) and many functions one knows from C family are inbuilt. The advantage, it's friction free, hassles about memory management, dynamic typing allows rapid development, experience, etc.

The focus of PHP is all around the web, it was the first successful language designed for the web. All inbuilt functionality has been carefully selected, everything is built in and can be used from the start. You only need to copy the files via (S)FTP or SCP to the shared hosting server (nowadays it would probably be called "server less", e.g. Amazon Lambda) and press F5 to reload the page. It's basically the easiest environment to start, and can be Sean as the successor of Visual Basic 6 as the entrance for many younger devs after 1999 in the programming world. And the good thing almost all the negative cruft of the earlier era got removed with PHP5 and PHP7 (and the compatibility is still there, old PHP4 code still runs (or with minor changes)).

Today most languages like Python, Ruby, Perl, Java, etc also offer asynchronous frameworks to let them scale a lot better - compared to them, you don't have to change your code with PHP, it was always shared nothing and is fast by default - according to benchmarks often faster than Python, Ruby, etc.

Nodejs, Go and Java offer nowadays very comparable performance (with Java and Go being slightly faster) in common benchmarks and real world. Nodejs with (vanilla) JavaScript and PHP allow for faster development - no static typing, no compiling step.

Erlang/Elixir is the latest hype. Beside some different terminology and focus around functional language parts, actors model, the inner working of ErlangVM and e.g. HHVM are not so different. The shared nothing, one thread per execution model offers similar results. ejabberd XMPP server software written in Erlang and used at WhatsApp (now part of FB) revived the interest of Ericson Erlang eco system. PHP can handle such chat services as well, see Slack. https://slack.engineering/taking-php-seriously-cf7a60065329

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

#45

Earlier quoted context omitted.

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…

I fully agree. Its all about how to do x stuff at y cost. PHP served a market segment. Now the other languages can do the same, if not better, at the same cost.

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

#46
post #41

Is there a PHP modding squad in Hacker News? Legitimate, non-offensive anecdotes are getting downvoted in this thread while all positive comments are being upvoted. I think I've seen such a trend rising in the past few years, but I wasn't sure: every thread covering PHP in some way gathered a crowd that defended "how PHP is much better since 5.x" or referred to PHP being hated by people without any good reason. And y…

My guess is there isn't and non constructive criticism just tends to get down voted.

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

#47
post #40

Earlier quoted context omitted.

> 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...

the fact that you had to google it is delightfully fitting.

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

#49

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…

PHP in general is easy to write. Philosophically, it's all over the map due to mostly historical reasons. People say that the current development team are making it better and I don't disagree. There's just so much you cannot do when the core is so shakingly built.

Still, most of the uglies of the languages can be learned and then circumvented in action or by using proper tooling.

PHP 7 followed the general trend of bringing stronger types into dynamic languages. You can now annotate function arguments with types. I believe that makes it possible to write a static type checker, but I haven't seen one yet.

Why people hate it? I cannot speak for the whole public, but I dislike the language because it let me down. My first experience with PHP is from 1998ish, when I saw it as a way superior option to Perl, and ported a web application to PHP.

After that, I learned about programming. I didn't touch PHP again until 2013, when I got a job in a PHP shop. I went there with an open mind, thinking that the programming language is one of the least important things when building products. But every step of the way, PHP somehow got in my way. It hadn't gotten better in ways I would've liked. It let me down.

Now, of course, I don't work there anymore, so the amount of fucks I give at the language is slowly declining. Soon, I'll be able to not care at all.

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

#50

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…

It's still kickin'.

I left the PHP world a few years ago, but I still have to go back occasionally to manage a few old projects. I recently upgraded one to PHP 7.*. It's soooooo much faster than older versions I consider it a must have for anyone working on PHP.

That said one thing I don't regret is not having to deal with composer again. It's basically a shittier version of npm, with a fraction of the speed and a fraction of the logic built in. I have projects that have installs that aren't idempotent due to weird composer caching issues. Composer is a good thing but I can't help but wonder if PHP simply isn't fast enough of a language to build a package manager in.

Post reply on HN