Live data from Hacker News

A look at modern PHP

lwn.net

11–20 of 610 posts

Re: A look at modern PHP

#11
Many of the features highlighted in that article as "new" are from PHP 5.x, so it reads more like a list written by someone who has been out of touch with PHP development for a number of years.

Re: A look at modern PHP

#12
post #7
post #2

PHP hater sheeps incoming

I cut my teeth on it years ago, I don't hate on it for cheap jokes. That said I don't know why anyone would pick it to start a new project in 2020. We've been lucky to have so many new and established options that are better in almost everyway.

"so many new and established options that are better in almost everyway"

such as?

Re: A look at modern PHP

#13
post #7
post #2

PHP hater sheeps incoming

I cut my teeth on it years ago, I don't hate on it for cheap jokes. That said I don't know why anyone would pick it to start a new project in 2020. We've been lucky to have so many new and established options that are better in almost everyway.

I think it depends on the types of project or the target of the said project.

Recently I had to develop a very small CMS that manages personal web pages and it was a requirement that it could be installed very easily (i.e., by copying a single file) on virtually any hosting provider. PHP was (and is) still the natural candidate for such projects.

Re: A look at modern PHP

#14
Even with PHP7, PHP still feels like it is playing catch up. There is nothing new or revolutionary in PHP7, just adopting features present in other major languages. Adopting as other newer languages like Go and Rust seems to be moving beyond those features. A catch up into a world that's on its way out, if one will feel so blunt.

PHP's raison d'être remains its ease of getting an instance running on a webserver. But with fewer people self-hosting these days, that has become less an advantage. And even for those who do self-host, the advantage is becoming narrower as other languages have made it easier to distribute their web applications.

Pascal, COBOL, Oracle DB and PHP today seems like technologies that only stick around because they are legacies being maintained, not because people start new grand projects with them. Would Wordpress have chosen PHP if they started today?

Re: A look at modern PHP

#15
For web backend, being able to ship a single binary, such as what Rust and Go can provide, is really nice. I don't see PHP as a more compelling solution than either of those languages.

Scripting and command line automation is executed better by Python and Ruby, which excel for writing Unix scripts and tools.

I do not see what the use case for PHP is in 2020.

PHP has one of the most abhorrent language syntax designs this side of Perl, and the standard library is wildly inconsistent.

I really wish PHP would just die. Continuing to drag it along like the dead carcass it is wastes so much human effort. The longer it exists, the longer we have to support it.

Re: A look at modern PHP

#16
I very rarely write PHP and will probably never have to use these features, but I think that the combination of the FFI and preloading can be quite a powerful thing.

Re: A look at modern PHP

#17
I've been using PHP for over 15 years and always liked it. There is no other webserver language that's so easy to use and so deployable while still being fast.

But for larger projects the available frameworks are just okayish. I think Symfony is closest to what a good framework should be. But every time I use it I wish it would be like .NET

Today .NET core is also available on Linux and very easy to deploy so I don't think I will ever start a big project in PHP again.

But for quick smaller and CMS[1] projects PHP is still my goto language.

[1] If you are looking for a great PHP CMS: https://processwire.com/

Re: A look at modern PHP

#18
post #17

I've been using PHP for over 15 years and always liked it. There is no other webserver language that's so easy to use and so deployable while still being fast. But for larger projects the available frameworks are just okayish. I think Symfony is closest to what a good framework should be. But every time I use it I wish it would be like .NET Today .NET core is also available on Linux and very easy to deploy so I don't…

I always enjoyed Laravel

Re: A look at modern PHP

#19
I use php daily. Mostly Symfony/Laravel stuff. There are still some stuff it needs what other languages have. (Can't really right now remember all the stuff i stumble upon sometimes which gives me the feeling "damn if i could do this like i do it in rust/java/cpp/(w/e)")

Maybe the worst thing is the composer (it's slow.)

Re: A look at modern PHP

#20
I have been coding in PHP for 15 years (not exclusively) and indeed many things had to improve. Nevertheless, many other languages also had to. Just as an example, PHP had a much more mature vendor requirements system than Go and years before! What I see many people tend to fail to observe is that a language is also good as the amount of value it can being to the business and in that PHP was and still is phenomenal. Anyhow, I'm really happy to see how it has evolved.
Post reply on HN