Christian Schneider wrote: > 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.
Yup, I agree. Having to sit and count arguments and figure out the types in order to determine which actual method is being called makes it damn near impossible to debug code as far as I am concerned. And what does the callgraph from a profiler look like? kcachegrind doesn't show the function signature in the callgraph which means we would have to map these methods to some unique name and people would have to know how to map these names back to the correct function signature. Sounds like a mess to me. -Rasmus -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php