Re: [RFC] Safe Casting Functions

From: Date: Wed, 22 Oct 2014 22:14:48 +0000
Subject: Re: [RFC] Safe Casting Functions
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-78254@lists.php.net to get a copy of this message
Hi, On Thu, Oct 23, 2014 at 1:01 AM, Zeev Suraski <zeev@zend.com> wrote: > The RFC itself makes an assertion that fundamentally contradicts the notion > that these are 'just functions'. The RFC reads 'They also prevent any > suggestion of strict type hinting for scalar types, because if that were to > be added, users would simply use dangerous explicit casts to get around > errors and the result would be code that is buggier than it would have been > without type hinting at all.' While it doesn't explicitly say so, it's > clear that one of the goals of the RFC is make it easier for a 'strict > typing' RFC to be accepted in the future. This is a clear indication this > constitutes a fundamental change to the core language. I'd argue that it has the exact opposite goal - to be able to say "use to_string(), to_int(), etc; we don't need strict type hinting". Though, I'd also argue that this isn't a valid argument - it's a different feature. Cheers, Andrey.

« previous php.internals (#78254) next »