Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32756 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50054 invoked by uid 1010); 14 Oct 2007 12:27:06 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 50039 invoked from network); 14 Oct 2007 12:27:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Oct 2007 12:27:06 -0000 Authentication-Results: pb1.pair.com smtp.mail=cschneid@cschneid.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=cschneid@cschneid.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain cschneid.com from 195.226.6.51 cause and error) X-PHP-List-Original-Sender: cschneid@cschneid.com X-Host-Fingerprint: 195.226.6.51 darkcity.gna.ch Linux 2.6 Received: from [195.226.6.51] ([195.226.6.51:46850] helo=mail.gna.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D0/10-48713-81B02174 for ; Sun, 14 Oct 2007 08:27:05 -0400 Received: from localhost (localhost [127.0.0.1]) by darkcity.gna.ch (Postfix) with ESMTP id D9487137B1E; Sun, 14 Oct 2007 14:27:01 +0200 (CEST) Received: from unknown by localhost (amavisd-new, unix socket) id client-XXOnIVTm; Sun, 14 Oct 2007 14:27:00 +0200 (CEST) Received: from box.local (77-57-14-223.dclient.hispeed.ch [77.57.14.223]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTP id 868EE137B17; Sun, 14 Oct 2007 14:27:00 +0200 (CEST) Message-ID: <47120B07.3070801@cschneid.com> Date: Sun, 14 Oct 2007 14:26:47 +0200 User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Marcus Boerger CC: internals@lists.php.net References: <7C37FF3A0196094F95430BA95952032211B7C5@s1.mkj.lan> <7C37FF3A0196094F95430BA95952032211B7C7@s1.mkj.lan> <72129346.20071014092922@marcus-boerger.de> In-Reply-To: <72129346.20071014092922@marcus-boerger.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at gna.ch Subject: Re: AW: [PHP-DEV] Method overloading by method signature From: cschneid@cschneid.com (Christian Schneider) 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