Re: Scalar Type Hints v0.4

From: Date: Wed, 18 Feb 2015 12:57:02 +0000
Subject: Re: Scalar Type Hints v0.4
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-83058@lists.php.net to get a copy of this message
2015-02-18 12:45 GMT+01:00 Rowan Collins <rowan.collins@gmail.com>: > Michael Wallner wrote on 18/02/2015 11:39: > >> On 18/02/15 12:31, Rowan Collins wrote: >> >>> Michael Wallner wrote on 18/02/2015 11:19: >>> >>>> On 17/02/15 23:03, Sara Golemon wrote: >>>> >>>> 1) Introduce scalar types for primitives: bool, int, float, string, >>>>> resource, object (we already have array) >>>>> 1a) Introduce meta-types as pre-defined unions (we can add custom >>>>> unions in a later rfc). A possible list may be as follows (again, we >>>>> can argue what's in this list separately): >>>>> * mixed: any type >>>>> * scalar: (null|bool|int|float|string) >>>>> >>>> Hold on, usually, type checking functions don't identify NULL as scalar. >>>> >>> No need for anyone to hold on; as it says in the section you've quoted >>> "we can argue what's in this list separately". Sara's after >>> reactions to >>> the principle of having meta-types/unions in general, not their >>> definitions, right now. >>> >> Did you already incorporate "strict mode" yourself? >> SCNR >> >> I'm not a native speaker, so "hold on" might mean something different to >> you than to me. >> >> > Sorry, what I meant was, "don't worry, this isn't the kind of issue that > we need to worry about yet". > > Sara's e-mail made clear that these were quick examples, and she wasn't > expecting feedback on the details at this stage. > > Still, nullable types is something that had been proposed several times in this list, and fits nicely with the introduction of union-types. So, yes it would be nice null not to be included in scalars. Instead, we could have a union type like scalar? = scalar|null Lazare INEPOLOGLOU Ingénieur Logiciel > Regards, > -- > Rowan Collins > [IMSoP] > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.internals (#83058) next »