Hi Francois,

On Thu, Apr 30, 2015 at 6:23 AM, Yasuo Ohgaki <yohg...@ohgaki.net> wrote:

> Allowing any forms of int/float as string(and GMP) for weak mode int/float
> type hint
> would be alternative resolution for this issue. I think it's better than
> "numeric" type
> hint.
>
> It seems current weak/strict type hint difference is
>  - weak: allow conversion, force the type
>  - strict: not allow conversion, force the type
>
> If weak mode allows this
>
> function foo(int $val) {
>   // $val became "int" if value fits for int
>   // otherwise "integer string" or "gmp" object accepted
>   // anything else is error
> }
>

I forgot to mention float. 32 bit machines uses float as int extensively.
So it should be

function foo(int $val) {
  // $val became "int" if value fits for int
  // (allow float value that is integer form)
  // otherwise "integer string" or "gmp" object accepted
  // anything else is error
}

Regards,

--
Yasuo Ohgaki
yohg...@ohgaki.net

Reply via email to