Re: [RFC] anti-coalescing-operator
| From: | Claude Pache | Date: | Fri, 25 Oct 2019 10:26:55 +0000 |
| Subject: | Re: [RFC] anti-coalescing-operator | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-107694@lists.php.net to get a copy of this message | ||
> Le 25 oct. 2019 à 01:23, Sara Golemon <pollita@php.net> a écrit :
>
> Just testing the waters: Is there any appetite to have AND and OR behave
> more like Pythons operator?
> Instead of now:
> (a or b) => bool(true) if either of a or b are true
> (a and b) => bool(true) is either of a or b are true
>
> Behave as:
> (a or b) => Value of a if true, b if a is not true but b is, bool(false)
> otherwise.
> (a and b) => Value of b if both are true, bool(false) otherwise.
>
Besides BC concerns, it is probably not a good idea to introduce (more) subtle differences between
and and &&. That is, if you change and, you should
change && in the same direction.
Maybe simply introduce the !?: operator?... Nevermind.
—Claude