Hacker News new | past | comments | ask | show | jobs | submit login
Can I PHP? – caniuse.com but for PHP features (caniphp.com)
48 points by stanislavb 11 days ago | hide | past | favorite | 8 comments

This site provides a nice overview, cool. It makes me wonder though, because IMHO PHP is adding too much new features that are often somewhat half-baked. What would be better is to have an actual specification to improve the core language. IIRC, Python gradually adds features where they are opt-in first (from __future__ import foo).

I'd gladly take a language which offers stability and gradual improvement over a language that just keeps adding new toys to play with. The software development cycle can take many years and from my experience, changes in the language or runtime are a burden.

But my biggest gripe isn't with PHP, it's that cheap web hosting still comes with PHP and MySQL. And I honestly can't blame them.


I am working on a ~10 year old PHP project, the amount of changes that needed to be made in the last decade because of the changes in the language are almost non-existent.

But using new features is nice and makes the code better, there are even projects (rectorphp) that can automate using of new features in the existing codebase.

The only time I've ever had to update legacy code due to a breaking change in PHP is when an old encryption algorithm was withdrawn and I had to write a migration to decrypt and re-encrypt the data we'd originally encrypted with it. Apart from that (and a few notices sent to Sentry) it's been smooth sailing over the years.

upgraded a large badly written php 5.6 codebase to 7.1 then 7.4 and then 8.0. first jump took about 3 days of work to iron out issues then going to 7.4 and 8.0 was even quicker. using the php compatibility checker helped a lot.

You can say what you want about PHP but this is at least proof that it's moving in a genuinely good, and potentially exciting, direction.

I still don't know that I ever want to write any more PHP going forward but should these efforts continue, I'll need to re-evaluate that opinion.

I agree. I learned PHP at the time of PHP 3 and then 4. It was my first programming language. I grew critical of it as time passed and, like most people, made fun of its lot. But its ease of use and ubiquity still made it practical for some small projects in the following years (mid 2000s).

Then, in 2014, I got a job where PHP was the main language and I was surprised it had improved so much (though I left around a year later and haven't done any PHP since). I find it very impressive that they've been able to address many of the criticisms they received and that they keep introducing concepts that are popular in other languages, all the while mostly starting backward-compatible.

I probably still wouldn't pick it for a project—simply because there are other languages that I prefer or would like to learn—but I respect it a lot more than I used to and understand why many like it.


for some it is their first, for others it is their only

If only someone wrote fastcgi bindings for qbasic.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact