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

From: Date: Mon, 14 Jul 2014 16:49:40 +0000
Subject: RE: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.internals 
Request: Send a blank email to internals+get-75488@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 7:44 PM > To: Zeev Suraski; Andrea Faulds > Cc: internals@lists.php.net > Subject: Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening) > > Zeev Suraski wrote (on 14/07/2014): > > I do believe that the vast majority of people would want '32 ' and > > "42\n" > > to silently convert to 32/42, and will generally not care much about > > '32abc' converting to 32 either for the sake of consistency. > > And passing 'hello' to a function type hinted as int? Will people really > expect > that to become a 0, with a mild warning they may not even have enabled? I'd say absolutely yes, if they're PHP developers that's exactly what they'd expect. After all, if you use 'hello' today in any integer context in PHP, explicit or implicit, that's exactly how it will behavior across the language. Zeev

« previous php.internals (#75488) next »