On Wed, 11 Mar 2015, Zeev Suraski wrote:

> From: Anthony Ferrara [mailto:ircmax...@gmail.com]
>
> > > function bar(float $x)
> > > $foo = 1;
> > > bar($foo);  // will definitely fail in strict mode
> >
> > No, actually it won't fail in strict mode:
> > https://wiki.php.net/rfc/scalar_type_hints_v5#integers_should_be_accepted
> > _for_strict_float_arguments
> 
> You're right, sorry.  Reverse it then:
> function bar(int $x)
> $foo = 1.0;
> bar($foo);  // will definitely fail in strict mode

And it should fail, as logically it is the same as:

$foo = 1.901 - 0.709 - 0.192;
bar($foo);

which is only 1, if you look at it with a small enough precision.

cheers,
Derick

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to