Re: [RFC] Scalar Type Hinting With Casts (re-opening)

From: Date: Tue, 15 Jul 2014 13:21:52 +0000
Subject: Re: [RFC] Scalar Type Hinting With Casts (re-opening)
References: 1 2 3 4 5 6 7 8 9 10 11 12  Groups: php.internals 
Request: Send a blank email to internals+get-75542@lists.php.net to get a copy of this message
On 15 Jul 2014, at 14:18, Ferenc Kovacs <tyra3l@gmail.com> wrote:

> you can't optionally introduce strict typing to php, as the two of them
> can't co-exists.
> nobody forces you to not use a language with strict typing if you want
> that, but I don't think that it would worth changing the php type system at
> this point.

It’s also worth noting that if you do want strict typing in PHP, you now have an alternative:
Hack. Hack even allows you to mix strictly-typed code with non-strictly-typed code if you want. But
PHP is not going to go in that direction. This RFC offer rather strict validation of input to a
function, but it does not offer strict *typing*, as strings and floats, where interchangeable, are
accepted.

> as I mentioned above, nobody argues that input validation (and escaping
> output in a context sensitive manner) is a must.

Isn’t a must, surely? (I assume that was a typo)

--
Andrea Faulds
http://ajf.me/






Thread (250 messages)

« previous php.internals (#75542) next »