RE: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

From: Date: Mon, 14 Jul 2014 15:46:16 +0000
Subject: RE: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-75478@lists.php.net to get a copy of this message
> -----Original Message-----
> From: Rowan Collins [mailto:rowan.collins@gmail.com]
> Sent: Monday, July 14, 2014 6:28 PM
> To: internals@lists.php.net
> Subject: Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)
>
> Derick Rethans wrote (on 14/07/2014):
> > A compromise by adding more inconsistencies.
>
> The only way of not introducing some inconsistencies (or, to put it
another
> way, new features) is to use strict type hints

Actually there's a pretty simple way that's not strict type hints:

5) Add type hints using existing syntax, which are casts;  Change casts
(both existing and these new ones) to emit a new E_CAST in case of data
loss or 'bogus' conversions.

Zeev


Thread (250 messages)

« previous php.internals (#75478) next »