Re: Nullable cast (?int)

From: Date: Tue, 31 Jul 2018 22:58:09 +0000
Subject: Re: Nullable cast (?int)
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-103001@lists.php.net to get a copy of this message
Thanks a lot! 1. I never did a RFC and have no karma to do, so if someone wants to help me with that, I appreciate (contact me directly, then we could publish RPC link as reply here). 2. Too, I could not implementate it, and I don't know if it is a requirement to write a RFC or if it could be done in another moment. 3. What PHP version it should be focused? 7.4, right? Em ter, 31 de jul de 2018 às 16:50, Claude Pache <claude.pache@gmail.com> escreveu: > > > > Le 31 juil. 2018 à 21:07, Sara Golemon <pollita@php.net> a écrit : > > > >> On Tue, Jul 31, 2018 at 2:23 PM, David Rodrigues < > david.proweb@gmail.com> wrote: > >> Currently we have support to (int) cast (and similar). But I do think > that > >> we too need a possibility to do a nullable cast. In terms, it will cast > to > >> (int) only if value is not null, else it should be kept as null. > >> > > I like this proposal. Short, simple, and consistent with other parts > > of PHP syntax. Write up an RFC for it? > > > > -Sara > > > > And, please, also consider settype($x, '?int'). > > I have userland functions in my code for those type of casts. > > —Claude > > -- David Rodrigues

« previous php.internals (#103001) next »