Live data from Hacker News

Benchmarks of PHP 7.2 Beta: PHP Is Still Getting Faster

phoronix.com

61–70 of 144 posts

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

#61
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 PHP's legacy.

I wish someone created a PHP class one could use to namespace sane function names and parameter order:

    \PHP\html_entities()
    \PHP\url_encode()
EDIT:

...and here it is: https://github.com/nkkollaw/php, discussion here: https://news.ycombinator.com/item?id=14885226.

Pull requests welcome :-)

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

#62
post #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 P…

Unless you are using ReactPHP it's not really for real time apps.

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

#63

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 can't answer your question, but I'll tell you why I didn't choose PHP many years ago for a web app:

1. PHP is very welcoming to beginners. That's of course a good thing, but the downside is that it's actually quite difficult to get quality answers on StackOverflow, which is rife with clueless trial-and-error answers and "Just use , dude" kind of responses

2. PHP started out as a simplistic server-side templating/expression language; which is fine by itself, but without any kind of injection prevention is incredibly naive, and the reason for so many DDOS botnets. Of course, using embedded PHP (eg. in a processing instruction in your otherwise static HTML) hasn't been considered best practice for years. But then why use PHP at all, when this distinguished feature isn't usable, and neither is PHP a standardized language, nor is its stdlib any good. In fact, this retargetting of PHP with little or no architectural oversight (from an expression language into a full-blown app language with OOP and whatnot) seems endemic in the PHP world, and is also the case with eg. WordPress.

That said, I quite like the PHP community for their practical-mindedness and their get-stuff-done mentality.

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

#64

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…

I get your point but also consider that messing around with installing php extensions and using pecl is more of a nuisance than just deploying your node_modules via something like rsync. The php community solves this by writing polyfill which seems like wasted effort (writing something in php that already exists as a php extension)

I don't think pecl sees much use now, depending on your package manager you can just install most modules from there ("apt-get install php-imagick")

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

#65
post #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 P…

Isn't Slack an example of a non-scalable architecture? There is a long time hard limit to the number of people accepted in a Slack channel (around 10,000 I think).

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

#66
post #28

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 weird for me. I used to write both Java and PHP in the past. Custom PHP framework we built took into account the way PHP is executed: you are stateless and need to setup everything on every request (runtime is fast to start with FPM and opcode cache). Namespaces based cheap autoloader worked great. No composer. We used singletons for getting the configuration and connections to DBs. There was almost no setup cod…

I've improved this comment a bit over here:

http://vrodic.blogspot.hr/2017/07/my-thoughts-on-php.html

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

#67

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…

that should be static \PHP\String\htmlEntityEncode() and static \PHP\String\urlEncode()

good luck

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

#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 "old" dotNet Framework has been deprecated for a slightly incompatible new dotNet Core namespace and several namespace parts got deprecated long before, some got useless with the move to asynchronous programming (something C/C++ based WinAPI supported since 1994), etc.

What history showed us that monolithic namespaces designed by committee doesn't work out that well, an organic growth may look ugly to you but is easier to remember and quite sympathetic - I for one like PHP also because of that. JavaScript, C99, C++11, have a similar long term history.

Also PHP is so great because of it best of class documentation on PHP.net - no other language has such an extensive docu (and for so many years) incl useful comments on every page. JavaDoc, MSDN, MozillaWiki, etc are unfortunately worse in every regard. (MDN is catching up; and even W3School is quite handy)

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

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

With PHP you also need to implement a webserver (Apache), so you're one-liner is also actually not a one-liner at all.

Also, pick the right tool for the right job. Who writes code these days that silently sit still for a decade? Hardly anyone. And even if you do, I don't think Python or Node will suddenly stop working (as you're implying).

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

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

tl;dr PHP has an identity crisis

PHP folks are a perfect case of the blub paradox and they are sadly always looking up. PHP isn't treated with the respect it deserves. PHP powers large parts of the internet, from tiny to huge projects. But there isn't even an attempt to understand what it made/make work so well. PHP is quite different from other languages but instead of curiosity from the competitors, there is just bad reputation and ignorance. The community and language itself constantly leans and evolves towards other languages. Ruby, Java, Javascript and whatever. The shortcomings in contrast to other languages are often drawing much attention in the community and in my opinion is overshadowing PHP's strengthes. Much of the recent changes in PHP have been a kind of fanservice to appeal the users of other languages. While this isn't particularly a wrong strategy to stay around, it caused an addiction to be more similar to the competitors. PHP lost it's identity and got unknowingly angry about it.

This is just my opinion and there are some wrongs here, but thats how I would currently explain the sub par PHP community behaviour.

Post reply on HN