Live data from Hacker News

Benchmarks of PHP 7.2 Beta: PHP Is Still Getting Faster

phoronix.com

131–140 of 144 posts

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

#131

Earlier quoted context omitted.

"As for coding yes—one issue I have is that not using PHP exclusively I get confused by the fact that the opposite of html_entity_decode is htmlentities and not html_entity_encode" Ah yes. You will probably have to hit 'tab' on your IDE with php - to type "html_entity_encode". But if this is too hard - Here you go, Try it out in python (careful of the 2/3 quirks!): Python: https://stackoverflow.com/questions/275174/h…

I have no idea what you are talking about. How would hitting tab change html_entity_encode into htmlentities?

If you start typing `html` trying to get to `html_entity_encode` you'll notice a dropdown which will show you the right method to use. Unless you use notepad.exe or something.

https://i.imgur.com/YYXkkNS.png

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

#132

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…

This. When I got my first explanation of "serverless" (i.e. the details of the runtime and server are managed by the vendor for you) I almost laughed and said "Oh, like PHP on shared hosting."

I've wondered for years where else this aspect of PHP might be appreciated and show up in another ecosystem. In retrospect it almost seems obvious that it'd more likely appear in the form of convergent evolution combining another benefit that's higher status in the industry if less frequently needed.

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

#134
post #83
post #44

Earlier quoted context omitted.

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…

Both Erlang (1986) and Beam (Erlang VM, 1992) predate PHP (1995). And Elrang processes are not OS processes, though I get your main point.

While the language itself predates PHP, the hype doesn't.

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

#135

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/ex…

"Welcoming" is not a good thing. The worst thing you can do with a bunch of clueless people is make them prolific at writing code they don't realize is unreliable. We should be teaching the minority who have the aptitude and turning away the rest.

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

#136

Earlier quoted context omitted.

I have no idea what you are talking about. How would hitting tab change html_entity_encode into htmlentities?

If you start typing `html` trying to get to `html_entity_encode` you'll notice a dropdown which will show you the right method to use. Unless you use notepad.exe or something. https://i.imgur.com/YYXkkNS.png

I see, but htmlentities is just an example. It's a coincidence that they both start with 'html'...

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

#137
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 b…

$x == $y should guarantee that $a[$x] == $a[$y]. In PHP, it doesn't. That's not different, that's just broken, and the language design makes dozens of elementary mistakes like that where getting it right wouldn't have sacrificed the only strength (streamlined deployable server integration) in any way.

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

#138
post #100

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…

I work on a modern PHP 7.1 codebase, and I personally disagree: > 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. I know the functions you're talking about, and they're definitely a wart, but approximately 0% of my day is spent actually calling them directly. I spent a lot of time working with eg, collection classes whic…

I get what you're saying but your point is that inconsistencies with PHP aren't a problem because you use libraries instead of core functions.

That doesn't make core functions awesome, it's just that in your case you don't use them.

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

#139
post #103
post #94

Earlier quoted context omitted.

Yes, if you search Indeed.com's API by job title there are currently more Node.js jobs (384) than PHP (268) in London (excluding WordPress, Drupal, Joomla & Magento).

I'm not sure that's entirely fair; a lot of those jobs you've excluded will be serious PHP coding jobs, not just "install and configure a plugin" sort of things. There'd be a lot fewer node jobs if you managed to exclude all the ones that used express. :)

That's not a fair comparison. I didn't exclude PHP frameworks.

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

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

You can't have it both ways. You can't pretend that backend web development isn't software development when it's convenient and assert that it is when it seems prestigious.

Your example doesn't account for any complexity. All it seems to say is "You don't have to think about architecture or platform, you can pump out thoughtless abandonware with ease."

Post reply on HN