Live data from Hacker News

Benchmarks of PHP 7.2 Beta: PHP Is Still Getting Faster

phoronix.com

111–120 of 144 posts

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

#111
post #56

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…

> Its position as the #1 web server language has already been taken over by nodejs How so? Because when I put a PHP script on a server with " " that is a one-liner and I'm sure it'll work for the next 20 years. With nodejs, I have to implement the whole webserver and then my web app is also a server, even if it's "only" 20 lines of code and I need other tools to make sure that this server never crashes or automatical…

> How so? Because when I put a PHP script on a server with "" that is a one-liner and I'm sure it'll work for the next 20 years.

Web hostings have abstracted this for you. In reality, you need to install Apache or Nginx first. PHP does have a built-in server but its for testing only not production.

Nodejs is both a server and a webapp. You just need to install nodejs at bare minimum to run a "hello world".

Try installing nodejs and php on DO to see what I mean.

With regards to nodejs overtaking PHP, various stats from various sources back this up.

> it doesn't change all the time and you can be quite confident that it'll keep running for another decade.

Now thats just false. The switch to PHP7 from PHP5 alone has many BC breaks. Latest Drupal is a rewrite. Laravel LTS dont last "a decade". Code breaks all the the time in PHP land. The only thing that dont change in PHP world is WordPress.....

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

#112
post #92
post #15

Earlier quoted context omitted.

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

Just switch them to a $5/mth Linodode VM and push your one-off prepared Docker image. They're now getting 1GB RAM for their money so no complaints.

[deleted]

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

#113

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've been using PHP for many years now and I was very close to switch to NodeJS or Go a couple years ago until I discovered Laravel. That changed my view of PHP completely and it improved my code quality and potential by a 10x factor at least. I think that what Taylor Otwell has done in the last years with Laravel and with its ecosystem has been really underestimated. Not just for Laravel that is an excellent framework in my opinion, but especially with all the other products and libraries that he built along the way. It covers all the needs I had in building my last few SaaS products and it made my life soooo much easier.

A few examples:

Forge and Envoyer: setup and manage your VPS in a breeze and deploy your code with zero downtime.

Spark: create a SaaS product in literally a matter of minutes without having to care about all the boilerplates

Echo: real time notification across multiple channels (mail, Pusher, Slack, etc.)

Passport: OAuth2 API server as easy as it can be

Scout: Redis/Algolia search with just a couple of lines of code

Dusk: test your app easily both for unit and browser testing

Cashier: payments with Stripe and Braintree in a breeze (both for one time payment and recurring ones)

Socialite: OAuth for all kind of services (Facebook, Twitter, Google, ...)

And beside all this, there is the excellent Laracasts by Jeffrey Way that made me learn not just Laravel but PHP and JS in general in a really great way.

And I could go on talking with the great and simple queueing system, the perfect integration with VueJS that I love as well, ...

As you can see I'm a big big fan of Laravel in general and I hope that it will become popular in HN especially over time.

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

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

Why would you use Django, Rails, Go's net/http, etc. when there's almost always better tools for the job like laravel, symfony, silex, rust, etc?

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

#115
post #87

Earlier quoted context omitted.

I think he meant you can easily find $5 "unlimited" php web hosts. So for all intents and purposes it's serverless as in you can use it on a shared web host, where you do not have to manage the server because the hosting company does it. Not that it's literally serverless. Even lambda uses servers obviously. They just abstract it away which is what he meant. Clearly all cloud offerings are backed by servers, it's jus…

For $5 a month you can get a Linode VPS with 1GM RAM. After the one-off learning curve of Docker you can image these servers and get much more for your money than what any shared hosting provider has to offer. Better still, you're not tied to PHP either.

You're missing the point. The shared PHP host can be $5-$20 per year and handle bursts in excess of 1GB (assuming you're not grossly oversold, which is also common in VPSs).

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

#116
post #92
post #15

Earlier quoted context omitted.

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

Just switch them to a $5/mth Linodode VM and push your one-off prepared Docker image. They're now getting 1GB RAM for their money so no complaints.

This is exactly the type of response I expect from people who have never done this in real life, because real small businesses don't know what to do with that linode VM, don't know what docker is, and will end up undoing it all the day they need to make a 2 line text change and their neighbor who makes those changes for them in notepad can't do it anymore

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

#117

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…

My biggest complaint is that it's associative arrays are different than objects. So serializing and unserializing json can become a nightmare. This is easily circumvented by being careful to be consistent. But big libraries like symfony will change your json around and break things. In node it's just not an issue

When you decode json there is an option to set a flag that will allow you to use arrays or objects.

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

#118

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 fr…

I agree built in package manager wouid be awesome.

Composer is so much faster than npm in my experience but haven't moved to yarn so I might be missing some speed.

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

#119
post #88

Earlier quoted context omitted.

Really? So the main issue with php is a few functions have inconsistent parameter order? Ignore the massive speed improvements, composer package manager system or huge community. Good companies use php. I haven't met someone at facebook that can't code it. (please spare me the HHVM comment or how your intern friend does haskell in the basement). Have you read about python 2 vs 3? Have you actually seen real programmi…

Do you have a public example that illustrates how PHP/Hack code in Facebook looks like? My problem with PHP is that most of modern frameworks seem to take a lot from Java, and people have started to use type hinting whenever they can, so the code looks like (uglier) Java, but without advantages of performance (being made worse by having to setup everything on every request) or compile time type safety.

1) php doesn't have to setup everything on every request - opcode caches, process pooling et al exist

2) the benefit of php over java is that php is going to run everywhere with no effort, and running that same java based website/service is going to start with some doc on installing tomcat or similar, which will devolve into chaos as you start working with ssl certs or shared servers

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

#120
post #76
post #73

Earlier quoted context omitted.

As I remember PHP docs from back in the days, they were mostly crap with the occasional comment that told you how they were crap.

It's just you. PHP.net documentation was always better than the rest, easy to read, some simple examples and with helpful comments. JavaDoc, MSDN had no comments for decades, little examples and the later one lacked lots of API parts. Show me one online documentation of a language that is/was better. Also great are the book "Programming in C 2nd ed" and "Programming Lua", and the Golang focus isn't bad. PHP.net 2017…

Some awful stuff: http://php.net/manual/en/function.escapeshellarg.php http://php.net/manual/en/numberformatter.setpattern.php
Post reply on HN