News for hackers. Stuff that matters.
Re:PHP 8 by lgessler on Thursday November 26, 2020 @11:10AM (#25221177)
I'm kind of surprised they'd change a core language semantic, even in a major update... won't this make upgrading to PHP8 for a large codebase hard to do with confidence?
Re:PHP 8 by nikic on Thursday November 26, 2020 @11:32AM (#25221363)
That was certainly a concern. When instrumenting PHP to detect where the behavior changes and testing various codebases, I found that this actually happens much more rarely than I would have anticipated in advance. We're talking like 2 occurrences in the test suite of major frameworks.
Re:PHP 8 by chrisandchris on Thursday November 26, 2020 @12:48PM (#25222096)
Strict types (scalar type hints for method signatures) have been around since PHP 7, and since then I would say it is recommended to always use === (with type check) over == (no type check) so one would have enough time to upgrade it‘s code.

And it also just makes sense from the language design perspective to fix that behaviour. Having a major version coming is a good time to fix such stuff imho.

Re:PHP 8 by stephenr on Thursday November 26, 2020 @01:57PM (#25222671)
Strict comparison operators have been considered best practice since well before 7.0