пн, 16 июл. 2018 г. в 13:56, Zeljko Mitic <mitke...@gmail.com>:

> I tried to, but I honestly can't see the problem. No decent programmer
> makes error by sending wrong type of parameter and this feature is 100%
> optional. I know for sure that even in my dev computer, I would use this
> feature, and probably most programmers aware of the issue.
>
> Maybe simpler example: if I send a string to above function, the only
> difference is that PHP would start executing inner code. But an inner line
> like $user->getEmail() would still throw fatal error, still very easy to
> spot.
>
> But again, I really don't see that happening and I am not an expert. And I
> still never make errors like that, not even when I was learning php. And if
> dev computer keeps checking type (default), it is very easy to spot a big
> mistake like that.
>
> Given this is open discussion, I would like to see where I was wrong.
>
> Btw, you were not harsh at all.
>

Basically, you went wrong when you proposed a switch that controlls
language behavior. To add to that - a switch that probably is not
controllable by code that is running.

Long story short in a time of php 5.3 - 5.6 it was collectively agreed that
switches that control language execution are evil, are hard to maintain and
having language behave differently due to hosting enforcing one or the
other setting and you as a user having no way to control that is just bad.
Since then, the most evil switches were purged with extreme pregidece and
trying to introduce anything even remotly close to that is a suicide
mission :)

P.S. RIP magic_quotes, register_globals, short_tags and some other articats
of old. May you never be disturbed again.


-- 
Arvīds Godjuks

+371 26 851 664
arvids.godj...@gmail.com
Skype: psihius
Telegram: @psihius https://t.me/psihius

Reply via email to