Re: Reviving scalar type hints

From: Date: Fri, 20 Feb 2015 18:58:38 +0000
Subject: Re: Reviving scalar type hints
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-83343@lists.php.net to get a copy of this message
On 02/20/2015 10:52 AM, Josh Watzman wrote: > On Feb 20, 2015, at 10:30 AM, Rasmus Lerdorf <rasmus@lerdorf.com> wrote: >> Hack examples all using <?hh // strict >> >> echo number_format('1000'); >> echo htmlspecialchars(1000); >> echo md5(1000); >> >> These are all fine both as far as the type-checker is concerned as well >> as the runtime, of course, but they are runtime fatals in your proposed RFC.\ > > And they should be errors in Hack too. The reason they aren't are to ease transitions from > PHP to Hack. I'd expect them to be more strongly typed eventually. Right, you are doing a gradual transition of an API that wasn't written to be strict. It was written with the assumption that type coercion would take place. If there is a good reason to ease the transition from PHP to Hack there is an even stronger reason to ease the transition from PHP to PHP. -Rasmus

Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
« previous php.internals (#83343) next »