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

From: Date: Wed, 16 Jul 2014 19:22:01 +0000
Subject: Re: [RFC] Scalar Type Hinting With Casts (re-opening)
References: 1 2 3 4 5 6 7 8 9 10 11 12 13  Groups: php.internals 
Request: Send a blank email to internals+get-75597@lists.php.net to get a copy of this message
On 16 Jul 2014, at 20:17, Stas Malyshev <smalyshev@sugarcrm.com> wrote: > You say it as if it is an advantage. It is not. Having a rule that is > subtly different in 10% of places is actually worse than having one > totally different, because you start relying on it being the same, and > you don't change your tests to capture the elusive 10%, and everything > works just fine, and then you get in production scenario where data > happens to hit that 10% and your code goes bananas. It could cause problems, sure, but it’s worth pointing out that the rules this RFC uses are a strict subset of those zpp does; anything this RFC permits will be permitted by zpp, it’s the reverse that isn’t necessarily true. If you write your code to work with the stricter rules of scalar hints, it’ll work fine for internal functions. At the moment, of course, there’s no scalar type hints for userland functions, so it’s already inconsistent. -- Andrea Faulds http://ajf.me/

« previous php.internals (#75597) next »