On 28-4-2022 21:42, Rowan Tommins wrote:
On 28/04/2022 15:09, Juliette Reinders Folmer wrote:
Ah! So you're basically asking for the impossible. Search for a code pattern where a deprecation would not be useful, while noone has been able to come up with one.


Not at all. I'm saying look at how different people use the function, and then see how the deprecation would affect them, without searching for any particular code pattern.

That's exactly what I did with my recent RFC, and I found it a very useful exercise in understanding the impact: https://wiki.php.net/rfc/remove_utf8_decode_and_utf8_encode#usage

I would never have thought of some of the examples you showed in your earlier e-mail, so I'm genuinely curious what other patterns it's used for.


And that's basically exactly what I already did which led me to discover the patterns I posted about as they looked concerning (though I didn't use Nikic's tool, but the WIP PHPCompatibility sniff)...

I scanned a significant number of widely-used codebases and their dependencies and used the PHPCS `--report=code` view to see the code being flagged in context. - Some of the things flagged were/are false positives (WIP sniff, still fine-tuning), which I could dismiss out of hand. - Some of the things flagged is code which will start throwing deprecation notices (all good). - Some code pattern flagged peaked my curiousity as they wouldn't throw a deprecation notice, but would lead to reversed behaviour... which is when I posted about this in the channel with the typical pattern I identified as dangerous without deprecation notice.

Smile,
Juliette



Reply via email to