Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32792 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16328 invoked by uid 1010); 15 Oct 2007 19:24:27 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 16306 invoked from network); 15 Oct 2007 19:24:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Oct 2007 19:24:26 -0000 Authentication-Results: pb1.pair.com header.from=johannes@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=johannes@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 83.243.58.163 as permitted sender) X-PHP-List-Original-Sender: johannes@php.net X-Host-Fingerprint: 83.243.58.163 mail4.netbeat.de Received: from [83.243.58.163] ([83.243.58.163:49189] helo=mail4.netbeat.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 75/D6-39149-46EB3174 for ; Mon, 15 Oct 2007 15:24:22 -0400 Received: (qmail 25711 invoked by uid 507); 15 Oct 2007 19:24:14 -0000 Received: from unknown (HELO ?192.168.1.102?) (postmaster%schlueters.de@82.135.72.133) by mail4.netbeat.de with ESMTPA; 15 Oct 2007 19:24:14 -0000 To: "\"Timm Friebe\"" Cc: internals@lists.php.net In-Reply-To: <002f01c80f5b$d645d340$15b2a8c0@unterwegs> References: <7C37FF3A0196094F95430BA95952032211B7C5@s1.mkj.lan> <7C37FF3A0196094F95430BA95952032211B7C7@s1.mkj.lan> <72129346.20071014092922@marcus-boerger.de> <7C37FF3A0196094F95430BA95952032211B7CC@s1.mkj.lan> <19939840.20071014231353@marcus-boerger.de> <002f01c80f5b$d645d340$15b2a8c0@unterwegs> Content-Type: text/plain Date: Mon, 15 Oct 2007 21:24:10 +0200 Message-ID: <1192476250.2831.5.camel@johannes.nop> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-4.fc7) Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Method overloading by method signature From: johannes@php.net (Johannes =?ISO-8859-1?Q?Schl=FCter?=) Hi, On Mon, 2007-10-15 at 20:47 +0200, "Timm Friebe" wrote: > function xpath(DomDocument $arg) { > return new DomXPath($arg); > } > > function xpath(XmlTree $arg) { > return new DomXPath($this->loadXML($arg->getSource()))); > } > > function xpath($arg) { // Untyped = default > if (!is_string($arg)) { > throw new IllegalArgumentException('Unsupported argument type'); > } > return new DomXPath($this->loadXML($arg)); > } > > == > > If we consider the readability argument only: Which one of the above more > readable? You decide:) Allowing an untyped version next to a typed one is imo the worst thing one can do: f I want to read the code and first see the untyped implementation I certainly go crazy while trying to debug the code. johannes