Optional E_DEPRECATED for 8.0 in 7.4

From: Date: Fri, 22 Jan 2021 21:13:30 +0000
Subject: Optional E_DEPRECATED for 8.0 in 7.4
Groups: php.internals 
Request: Send a blank email to internals+get-112966@lists.php.net to get a copy of this message
Dear Internals,

Recently I started investigating how to migrate a fairly big project to PHP 8 and while most of the changes looked safe-ish, there was one that I was particularly worried about: few comparison rules were changed by "Saner String to Number Comparisons."[1]:

Comparison|  Before|  After
------------------------------
 0  ==  "foo"    |  true    |  false
 0  ==  ""       |  true    |  false
Would you consider adding a switch that, when turned on, issues a E_DEPRECATED on comparisons that are changed in 8.0 into 7.4? While it's kind of against semver, PHP doesn't strictly follow it anyways. It could be opt-in and I'm sure it can help migrating big applications with poorly tested logic that might rely on such comparisons. Nikita seems to have worked on this as there was a pull request on GitHub[2] that is now closed. So, is there a chance for a similar patch (with a new ini setting to make it opt-in) to get in? Patching and building PHP manually is always an option but I think that's not only my me who would benefit from it. I assume, an RFC is required; if the feedback is positive, I'd volunteer to work on it; I'd appreciate some C-help later on, though, if it goes forward, because I barely can C myself. What do you think? [1]: https://wiki.php.net/rfc/string_to_number_comparison [2]: https://github.com/php/php-src/pull/3917

Thread (1 message)

  • Alexander Kurilo via internals
« previous php.internals (#112966) next »