Lukas, Etienne, Hannes:

You all pointed out the issues and enhansments that can be done.
Basic thing I want to say that type hinting and data casting should be
done in tandem and work the same way. So generally there is a need to
rething how type casting works and implement enhansments with adding
type hints.

(int)42 = array(42) is a good point, it works now. With type hinting
it makes a catchable fatal error. So there is a question - make type
hints follow the cast rules, or cast rules should follow current type
hinting rules. Because although I don't see a problem in remembering
that $int = (int)"123abc" works fine and function a(int $int) {}
a("123abc"); fails with an error. But some argue to the ground that it
should cast also, or implement a strict type hinting (witch in my
opinion isn't for PHP, it's not in its nature, and I want PHP to
evolve it's own way, not to become a twin for Ruby, Python, etc),
because they don't want to remember rules for the type hints (btw, if
you can code PHP, C# and Python, you should have quite good memory and
some additional easy rules to remember isn't such a big thing).

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

Reply via email to