Live data from Hacker News

Benchmarks of PHP 7.2 Beta: PHP Is Still Getting Faster

phoronix.com

71–80 of 144 posts

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

#72

I don't think PHP's main problem is speed. It's generally used for websites, and a few milliseconds aren't going to make a difference when pages are so bloated by JavaScript libraries to often be 5-10MB. PHP's problem IMHO is that I wouldn't be able to use it if it wasn't for autocomplete: inconsistent function names, inconsistent parameter order. The ecosystem is fine, there's Composer, PSR, Laravel. The problem is…

If I remembered correctly, PHPs problem was never speed. All the conference talks back in the days were about how PHP-is-not-the-bottleneck-TM.

Funny thing is that a bit of async Nodejs blow it out the water then, but maybe DBs got faster and PHP couldn't hold up on I/O perf? I don't know.

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

#73
post #68

I don't think PHP's main problem is speed. It's generally used for websites, and a few milliseconds aren't going to make a difference when pages are so bloated by JavaScript libraries to often be 5-10MB. PHP's problem IMHO is that I wouldn't be able to use it if it wasn't for autocomplete: inconsistent function names, inconsistent parameter order. The ecosystem is fine, there's Composer, PSR, Laravel. The problem is…

Stupid idea IMHO. PHP is great BECAUSE it organic growth. It fully exposes the incorporated libraries with the same naming convention of the library functions and often additionally also in ObjectOriented style. Have a look how green field planned ObjectOriented Namespaces in Java and dotNet Framework 1-4 turned out. Java's String vs StringBuilder vs StringBuffer, Java's deprecated Date and Time classes, the whole "o…

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.

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

#74

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 don't know, but I didn't like my PHP years and it wasn't mostly because of the language.

Almost every PHP dev I knew did his own CMS and they were mostly horrible blobs of code and the "big" projects weren't any better. TYPO3 and WordPress were a mess and they were considered the industry standard...

I worked with code-bases that had files with 10k lines.

Everyone had to reinvent the wheel and all were bad.

It was like when someone started programming, they read somewhere that PHP is easy and so they started with it and since it was so easy to get the first "dynamic page" in the wild, they didn't bother to learn much about software engineering and even those who did simply followed the patterns blindly and ended up with the same mess, but different.

Somehow Node projects do better and I guess it's because there are more resources out there to "really" learn how to do things. On the other hand I have the feeling people are getting less independent. Some are crying for better docs or tutorials, while I figured it out while reading the source or browsing a few minutes on issues.

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

#76
post #73
post #68

Earlier quoted context omitted.

Stupid idea IMHO. PHP is great BECAUSE it organic growth. It fully exposes the incorporated libraries with the same naming convention of the library functions and often additionally also in ObjectOriented style. Have a look how green field planned ObjectOriented Namespaces in Java and dotNet Framework 1-4 turned out. Java's String vs StringBuilder vs StringBuffer, Java's deprecated Date and Time classes, the whole "o…

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 explode function: http://php.net/manual/en/function.explode.php

PHP.net 2005 explode function: https://web.archive.org/web/20050206214005/http://php.net/ma...

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

#77

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…

Pretty independent of recent improvements, but one thing I feel people are forgetting about PHP these days is that, when given to a good hosting provider, PHP is essentially "serverless" programming, but without the vendor lock-in stuff like AWS Lambda give you. (and without the hype) Admittedly, even on a good host it won't scale as ridiculously well as a lambda function does, but I'd wager scling from 1 to 1 millio…

I completely agree with you about the ease of hosting with PHP.

In fact, it's baffling that other popular languages for web development - such as Python and Ruby - have failed to address this issue of easy server installation. Developers underestimate how important this is.

If you want to sell a self-hosted solution to your customers, especially if they are small or medium-size businesses, it's impossible to offer an easy self-install solution using other languages (i.e. easy enough for non-technical users to follow instructions for install success).

Having a ridiculously easy web app installation process for servers would unlock countless opportunities for developers to reach more users or customers.

Programmer Jeff Attwood wrote about this in a critical post about PHP:

"If you want to produce free-as-in-whatever code that runs on virtually every server in the world with zero friction or configuration hassles, PHP is damn near your only option."

Attwood goes on to say we should:

"build compelling alternatives and make sure these alternatives are equally pervasive, as easy to set up and use as possible." [1]

That was written in 2012. And yet here we are in 2017 and there is still no other language that matches PHP for ease of server install, or for choice of hosting providers. I repeat: developers underestimate how important this is.

[1] https://blog.codinghorror.com/the-php-singularity/

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

#78
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…

I'm not saying the otheres were better.

I 'm just saying that PHP.net docs simply had false claims and they needed the users to comment and make them right.

I don't wanna know how much hours I lost with that, haha.

Well these days I simply look in the source, because it doesn't lie

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

#79
post #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…

Does PHP have linters or something that force you to use the practices you described? I find in Javascript that works pretty well to restrict the language to a sane subset.

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

#80

Earlier quoted context omitted.

Pretty independent of recent improvements, but one thing I feel people are forgetting about PHP these days is that, when given to a good hosting provider, PHP is essentially "serverless" programming, but without the vendor lock-in stuff like AWS Lambda give you. (and without the hype) Admittedly, even on a good host it won't scale as ridiculously well as a lambda function does, but I'd wager scling from 1 to 1 millio…

Are you referring to shared webhosting? Because if so, there's quite a few drawbacks. You're generally not in any sort of scalable setup, no high availability, you're on a shared box with other customers, you are susceptible to IO constraints on the shared disks, etc. You're still going to need a database of some sort for most applications....

> You're generally not in any sort of scalable setup, no high availability, you're on a shared box with other customers, you are susceptible to IO constraints on the shared disks, etc.

As you describe acceptable use-case for 99% of all projects.

Post reply on HN