Re: [RFC-Discuss] Scalar Type Declarations v0.5
| From: | Leigh | Date: | Wed, 18 Feb 2015 21:57:55 +0000 |
| Subject: | Re: [RFC-Discuss] Scalar Type Declarations v0.5 | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-83126@lists.php.net to get a copy of this message | ||
On 18 February 2015 at 21:50, Anthony Ferrara <ircmaxell@gmail.com> wrote:
>>> Static Analysis Is Possible With Weak Declarations
>>
>> The advocacy of allowing
accepts_float(returns_int());
>> doesn't help
>> the cause of static analysers in strict mode.
>
> Java does exactly this and is statically analyzable. So...?
As discussed elsewhere. You're absolutely right, it is up to the
analyser to throw a warning on this because it is a type-based
conversion rather than value based one.