Re: Inline conditional that returns null if falsy

From: Date: Fri, 12 Feb 2021 19:45:44 +0000
Subject: Re: Inline conditional that returns null if falsy
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-113159@lists.php.net to get a copy of this message
> The => is just a suggestion, other options using existing keywords is:
> return expr() then output();
> return expr(): output();
> 
> I do not know if other languages support something like that.


I think it might be a good idea to check other languages to see if they support something like this.
We could use their examples as points of reference for discussing whether to include this
functionality in PHP.

Cheers,
Ben




Attachment: [application/pgp-signature] Message signed with OpenPGP signature.asc

Thread (23 messages)

« previous php.internals (#113159) next »