Hacker News new | past | comments | ask | show | jobs | submit login

The thing I love most about PHP is that regardless of the new features they seldom break backward compatibility. I have a site created with PHP 5 that runs absolutely fine with PHP 7.0 and I don't remember we had to ever update anything in that huge codebase.

It's a pretty big achievement and avoids a lot of hassle for users as you don't have to maintain different versions of programming languages on a server.




I've had the exact opposite experience. It's unusual for an upgrade to not break something.

There are dozens of breaking changes in this release alone: https://github.com/php/php-src/blob/96c7d42a3ca9d822a08b3dd4...

Some of the changes are sadistic. "The precedence of the concatenation operator has changed relative to bitshifts and addition as well as subtraction." Have fun debugging code that worked perfectly well for years and now produces unpredictable results.


PHP7 will still be supported for a while. Debian will probably support it even further. You'll have a long ass time to fix these.

Even if you wanted to push the 8.0.0 to production as soon as it came out, you'd still have until November to run your tests on the RC branch and report any mishaps to the development team.

The backwards compatibility is mostly targeted to major platforms (Wordpress, Drupal, Magento, Symfony, etc).

> Have fun debugging code that worked perfectly well for years and now produces unpredictable results.

This describes my everyday experience with any language or codebase.

The cause for the unpredictable results are often human-related though, not version-related.

> Some of the changes are sadistic. "The precedence of the concatenation operator has changed relative to bitshifts and addition as well as subtraction."

I would gladly remove any code that does concatenation and math/bitwise on the same expression relying on the operator precedence. Sadistic is the person who writes these.

More than 2000 packages were analyzed and only 5 instances of that particular use were found[1], all bugs. This is a good change.

[1]: https://news-web.php.net/php.internals/105442


> > Have fun debugging code that worked perfectly well for years and now produces unpredictable results.

> This describes my everyday experience with any language or codebase.

That is horrifying. That should absolutely not be normal. I don't know what you work with normally, but it's clear that we are working in completely different worlds.


I don't know any programming context immune to human errors.

Stuff just breaks. Sometimes I get lucky and the guy before me wrote a cool test that prevents me from having to start a debugger, but the contrary is often the reality. OSS stuff is usually better, but not much better (OS upgrades always break, for example).


You're not likely to have something like the concatenation operator mixed with bitshifts. Most of the changes are more likely to be bugs in your code that remain undiscovered rather than things that worked perfectly fine before but are now broken.

These changes reflect how people use the language or what they already believe it to do.


You're talking about hypothetical code, but I am talking about actual code that worked fine but no longer works after an upgrade. Perhaps it was poorly written, but it was not buggy.

I can't think of a single time that I've seen a bug exposed by language changes. I have seen dozens of bugs created by language changes, however. (Mostly crashes).


If you're depending on very weird edge cases in PHP I'd consider that buggy even if it works.


This is a completely useless discussion if you're going to assume that code depends on "very weird edge cases" with no idea of what the code actually does.


You're welcome to post an example.


I love this too. Moving Pinboard from whatever flavor of PHP it was based on (in 2009) onto 7.3 only ran into two issues—something to do with the "explode" function, and requiring a certain kind of constructor in objects. All the rest of the migration pain involved libraries.

Granted, Pinboard is just a wrapper around some SQL queries, but that's what most PHP apps are. It was a big relief to find the migration so easy.


You should really like Common Lisp, then :) The language hasn't changed since mid 90s or so and many of the widely used libraries have gone for years without needing any changes.


You mean there is actually software out in the wild that is "done" i.e finished !


Likewise. I built a whole back-end in PHP 5 back in 2009 for a client. His front-end has changed a ton in that time, but the backend is still chugging a long in PHP 7 with no problems.


I with they don't do this. There are a lot of inconsistencies in PHP that should go away these days, but they still keep them because of backward compatibility.


But it does break a lot of times and still contains a lot of inconsistencies.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

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

Search: