2012/8/15 Stan Vass <sv_for...@fmethod.com>

> But "variable" typehints
>> don't serve any such purpose. Actually, one could even say that they
>> don't serve *any* purpose, short of providing the IDE with type
>> information, because your code would work just as well even without
>> the type check. If the type were wrong, it would just throw a fatal
>> error when trying to do something with it (like invoking a method that
>> does not exist).
>>
>
> Just like with argument typehints.
> Point me to an argument typehint that is required for your code to run.
>

Hi,

Point me to an argument inerfaces are required. Or boolean (would could use
0/1 instead). Or abstract methods. Or function/methods parameters (we could
use func_get_args()). Or default parameters. Or [insert random feature
here].

Or: Point me to an argument, why the array of "Foo" shouldn't be a
specialised class, that implements 'Iteratable'. With this your foreach
"problem" simply disappear and everything, what remains, is something to
make IDEs happy (with one line less to write...).

My opinion

Regards,
Sebastian


>
> You and Stas keep giving arguments against argument typehints, which is
> really awkward.


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

Reply via email to