On 6/21/2017 7:05 PM, Andrea Faulds wrote: > Hi all, > > Here's a small RFC for a small feature, which I've wondered about for a > while: https://wiki.php.net/rfc/unary_null_coalescing_operator > > What do you think of it? > > Thanks!
I would prefer [1] to be extended to any and everything that can be null, like Kotlin, Ceylon, and others have it. Otherwise one needs to change back and forth between one and two question marks depending on context. The null coalesce operator is more of a special form of the ternary operator, but this proposal is a different beast and closer to nullable types than to the ternary operator. Hence, using a single question mark comes more natural. [1] https://wiki.php.net/rfc/nullsafe_calls -- Richard "Fleshgrinder" Fussenegger
signature.asc
Description: OpenPGP digital signature