RE: [PHP-DEV] Reviving scalar type hints

From: Date: Thu, 19 Feb 2015 12:52:10 +0000
Subject: RE: [PHP-DEV] Reviving scalar type hints
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  Groups: php.internals 
Request: Send a blank email to internals+get-83177@lists.php.net to get a copy of this message
> -----Original Message----- > From: Lester Caine [mailto:lester@lsces.co.uk] > Sent: Thursday, February 19, 2015 12:24 PM > To: internals@lists.php.net > Subject: Re: [PHP-DEV] Reviving scalar type hints > > On 19/02/15 09:13, Zeev Suraski wrote: > > Obviously, I think 'weak' campers have a lot to gain too - by making > > sensible conversions work fine as expected, without having to resort > > to explicit casts. > > And everyone stands to gain from having just one mode, instead of two. > > The coercive typing approach would require each camp to give up a bit > > of their 'ideology', but it also gives both schools of thought *most* > > of what they want, including the key tenets for each camp (rejecting > > non-sensible conversions - always, allowing sensible ones - always). > > I believe that's what makes it a good compromise, a better one than > > the currently proposed RFC. > > Now that all made sense! > > My only grey area is 'allowing sensible ones' where the size is an > integral part > of what is 'sensible' ... the one where conventional strict typing uses a > type > of the right size? I think the guiding principal for these conversions should be no data loss. This may mean we have different limits on different architectures, depending on whether they're 32-bit or 64-bit. Zeev

« previous php.internals (#83177) next »