Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34295 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92377 invoked by uid 1010); 31 Dec 2007 12:10:00 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 92362 invoked from network); 31 Dec 2007 12:09:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Dec 2007 12:09:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=thrthr@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=thrthr@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.166.181 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: thrthr@gmail.com X-Host-Fingerprint: 64.233.166.181 py-out-1112.google.com Received: from [64.233.166.181] ([64.233.166.181:47856] helo=py-out-1112.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2B/8B-02434-71CD8774 for ; Mon, 31 Dec 2007 07:09:59 -0500 Received: by py-out-1112.google.com with SMTP id u77so7582244pyb.16 for ; Mon, 31 Dec 2007 04:09:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=YqKSgvgtAw3Cp9sbRsbW4IyL42myxj6+TqWJ7O1EusU=; b=h6rYt3cRzouAGO6ekMgRXH0Gs8RVmeqhPWGE2bZ3WTDsTXBE6CLIEMmvxY5QQB8imaBgG4dkikw50iuxoyg8vT8YMLlCzwlhL9VWOOCOTsU3o7wSEM70ObBbyDUIadmSx8DhKTXSWzRL3+h2+5qsvTumsuHzgHCAjz5M6lQKLxk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=t7m5poKyMfRRYN1uHiavF4DwDylfZe8FyDYBE5klvbc6oAi9jUowKbWdtfimYzvroI/w9mM9IWi1wStdamjIP8+PxvXb1wh92hLuQuICHGYpxIBx5y0zolFt+tlFu+noJMTiCNVTzAmOtsb1zc4YglLYGndfXXBji0jn6L9FRes= Received: by 10.142.49.4 with SMTP id w4mr3541637wfw.204.1199102997948; Mon, 31 Dec 2007 04:09:57 -0800 (PST) Received: by 10.142.127.3 with HTTP; Mon, 31 Dec 2007 04:09:57 -0800 (PST) Message-ID: <8697e5310712310409u289e643fo5d0b579a4fbd3311@mail.gmail.com> Date: Mon, 31 Dec 2007 13:09:57 +0100 To: "Mikko Koppanen" Cc: internals@lists.php.net In-Reply-To: <8cf711460712310358l3bd6b5b5sb90fc1e328561d51@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <8697e5310712310328n4c0fa235wb5654178028942bd@mail.gmail.com> <20071231113414.GD7861@mint.phcomp.co.uk> <8697e5310712310343v16f4ec02s2e04f9e608fefaf0@mail.gmail.com> <8cf711460712310358l3bd6b5b5sb90fc1e328561d51@mail.gmail.com> Subject: Re: [PHP-DEV] Re: Exceptions instead of Fatal Error when calling non existent method? From: thrthr@gmail.com ("=?ISO-8859-1?Q?Fredrik_Holmstr=F6m?=") > 2007/12/31, Mikko Koppanen > Calling methods without knowing that they exist sounds like a hack to me. How about using abstract classes or interfaces? If you look at, for example, python - calling methods that don't *know* exists is common practice, it's not a hack from my point of view. It's just easier to ask forgiveness then permission, to quote Hopper. I never understood the direction PHP is heading with type hinting, static binding (SPL-Types?), etc. While I don't directly oppose it I don't see any reason for it. I just thought that adding some type of ability to handle unknown method calls (without forcing *every* class to implement __call() in a specific way) would be a nice way for those of us that want to continue to use php as the dynamic, duck-typed language we learned. Maybe it will fall on deaf ears, but I thought it was worth a chance and at least propose it here on internals. Regards, Fredrik.