Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:14186 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1493 invoked by uid 1010); 23 Dec 2004 06:44:06 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 577 invoked from network); 23 Dec 2004 06:43:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Dec 2004 06:43:59 -0000 X-Host-Fingerprint: 80.91.229.2 main.gmane.org Linux 2.4/2.6 Received: from ([80.91.229.2:49422] helo=main.gmane.org) by pb1.pair.com (ecelerity HEAD (r3983)) with SMTP id 02/2C-06723-E296AC14 for ; Thu, 23 Dec 2004 01:43:58 -0500 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1ChMh6-0005Xs-00 for ; Thu, 23 Dec 2004 07:43:28 +0100 Received: from p508e3486.dip.t-dialin.net ([80.142.52.134]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 23 Dec 2004 07:43:28 +0100 Received: from sb by p508e3486.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 23 Dec 2004 07:43:28 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: internals@lists.php.net Date: Thu, 23 Dec 2004 07:43:16 +0100 Lines: 34 Message-ID: References: <5.1.0.14.2.20041222142706.02653980@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: p508e3486.dip.t-dialin.net User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en In-Reply-To: <5.1.0.14.2.20041222142706.02653980@localhost> X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Sender: news Subject: Re: [PHP-DEV] ReflectionClass::getMethod() From: sb@sebastian-bergmann.de (Sebastian Bergmann) Andi Gutmans wrote: > Exceptions should be thrown for errors. And trying to get a method that does not exist is an error. > Can anyone shed some light on this? Why was this changed? To make consistent use of ReflectionException, IIRC. For instance, the following code throws an ReflectionException as well. Now one could argue that there is no other way to signal an error in the __construct() than to use methods, but I think it is better to use the same error signalling in bith ReflectionClass::getMethod() and ReflectionMethod::__construct(). And besides, it is what Java does [1], so we cannot be that far off :-) Seasons's Greetings, Sebastian -- [1] http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html -- Sebastian Bergmann http://www.sebastian-bergmann.de/ GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69