Marcus Boerger wrote:
If you have such a patch you should definitively post it here so that we
can hve a look. Most interesting to us is however the oerformance impact. As
that was the main reason to go any further than adding return type hints.
Am I the only here who thinks that performance is not the major issue
with this approach?
Method signatures lead to a different style of programming I personally
wouldn't want to encourage in PHP.
I'm expecting some kind of "if you don't like it don't use it" answer
but I wouldn't want to bloat the language for such a feature anyway.
Example:
It's too easy for someone to think it's a good idea to change
function foo($x) { ... }
to something like
function foo(string $x) { ... }
function foo(int $x) { ... }
but this can lead to very subtle bugs as automatic type conversion can
trick you into passing something different than you thought and hence
could lead you to do
foo(strval($x));
all over the place to not get any surprises. A Bad Thing(TM) IMHO.
Regards,
- Chris
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php