Kcachegrind doesn't show the function signature in the callgraph because the 
parameter signature is not part of the function signature. If the parameter 
siganture would be moved into the function signature, kcachegrind would adept 
and show it.

Btw: You don't have to use it if you don't want to. But PHP5 didn't include 
type hints for no reason. The problem: Type hints don't make many sense right 
now.
Like I already wrote in another comment. If you would use type hints you would 
understand the need of overloading type hinted methods.

-----Ursprüngliche Nachricht-----
Von: Rasmus Lerdorf [mailto:[EMAIL PROTECTED] 
Gesendet: Sonntag, 14. Oktober 2007 16:50
An: Christian Schneider
Cc: Marcus Boerger; internals@lists.php.net
Betreff: Re: AW: [PHP-DEV] Method overloading by method signature

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



Reply via email to