News for hackers. Stuff that matters.
Re:What's new in PHP 8? by john-shaffer on Friday August 14, 2020 @12:43AM (#24153548)
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.

Re:What's new in PHP 8? by alganet on Friday August 14, 2020 @01:08AM (#24153807)
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

Re:What's new in PHP 8? by john-shaffer on Friday August 14, 2020 @11:27AM (#24159130)
> > 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.

Re:What's new in PHP 8? by alganet on Friday August 14, 2020 @11:55AM (#24159564)
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).

Re:What's new in PHP 8? by wvenable on Friday August 14, 2020 @02:37AM (#24154487)
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.

Re:What's new in PHP 8? by john-shaffer on Friday August 14, 2020 @11:12AM (#24158939)
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).

Re:What's new in PHP 8? by wvenable on Friday August 14, 2020 @01:56PM (#24161040)
If you're depending on very weird edge cases in PHP I'd consider that buggy even if it works.
Re:What's new in PHP 8? by john-shaffer on Friday August 14, 2020 @02:13PM (#24161290)
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.
Re:What's new in PHP 8? by wvenable on Friday August 14, 2020 @03:17PM (#24162088)
You're welcome to post an example.