Am 21.04.2022 um 16:09 schrieb Rowan Tommins <rowan.coll...@gmail.com>:
> All of that, and the "consistency" in the title of your RFC, is a complete
> distraction from the real questions:
> 
> 1) given a null input, and a non-nullable parameter, what should the
> run-time do?
> 2) what is the best way to help users update their code to be compatible
> with that new behaviour?

You are leaving out option 3 (which is not part of the RFC but should still be 
on the table IMHO):
3) Leave the behavior but change the parameter definition to nullable to match 
the implementation.

> For instance, $search = ($_GET['q'] ?? ''); is both shorter and clearer than
> $search = ($_GET['q'] ?? NULL);

Your version is lossy as you cannot distinguish between "empty query" and "no 
query was submitted" any longer.
While this is normally easily fixed checking other flags it needs additional 
work and cannot be done with a simple search and replace.

Regards,
- Chris

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to