Woow. The compromise proposed by Marcio looks awesome to me :) .

Andrea, I can understand that in the PHP logic, but IMO if the RFC does not
avoid people that use code like I present before i don't think it's
completely relevant.
I mean, if people still use old tricks because the type hinting doesn't
allow to make what they wanted, then things are not cool enough and should
be re-think. And actually i say that because I see easily me still using
old trick without type hinting... Becaue of this cast story.

Also notice that Marcio's point could be another way, like adding something
with @integer (random operator choice, do not keep that in mind) that make
the check strict... Then IMO this operator will be so much used that it
will not make sence that is not the default behavior.
That's why the proposal of Marcio is cool to me.

2015-01-01 16:59 GMT+01:00 Marcio Almada <marcio.w...@gmail.com>:

> The battle between strict type declarations vs coercive has been here for a
> while. My problem with coercion in detriment of strictness is
> that sometimes you DON'T WANT TYPE CASTING AT ALL. This new feature would
> create serious impediments. So I wonder if we couldn't have both (strict
> and coercive types declarations) and leave the current proposed type
> hinting syntax reserved for strict type declarations? Like in:
>
>     function(int $a, (int) $b) {
>          // $a will be strict
>          // $b will be type casted
>     }
>
> This way we can actually choose when to cast and when to be strict and both
> features could be voted independently without affect each other possible
> future adoptions.
>

Reply via email to