Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41855 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46514 invoked from network); 11 Nov 2008 16:17:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Nov 2008 16:17:16 -0000 Authentication-Results: pb1.pair.com header.from=david@grudl.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=david@grudl.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain grudl.com from 80.79.20.227 cause and error) X-PHP-List-Original-Sender: david@grudl.com X-Host-Fingerprint: 80.79.20.227 keeper.orionet.cz Received: from [80.79.20.227] ([80.79.20.227:56644] helo=keeper.orionet.cz) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5D/4C-07308-B00B9194 for ; Tue, 11 Nov 2008 11:17:16 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by keeper.orionet.cz (Postfix) with ESMTP id 084DE1840982 for ; Tue, 11 Nov 2008 17:17:13 +0100 (CET) Received: from keeper.orionet.cz ([127.0.0.1]) by localhost (keeper.orionet.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 06030-02 for ; Tue, 11 Nov 2008 17:17:12 +0100 (CET) Received: by keeper.orionet.cz (Postfix, from userid 1005) id E47671840986; Tue, 11 Nov 2008 17:17:12 +0100 (CET) Received: from [192.168.1.23] (unknown [77.240.188.66]) by keeper.orionet.cz (Postfix) with ESMTP id 9ECCA1840980; Tue, 11 Nov 2008 17:17:12 +0100 (CET) Message-ID: <4919AFE5.5000203@grudl.com> Date: Tue, 11 Nov 2008 17:16:37 +0100 User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: PHP internals , marcus.boerger@post.rwth-aachen.de Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at example.com Subject: New SPL exceptions proposal From: david@grudl.com (David Grudl) Hello *internals* and Marcus! What do you think about possibility to implement to PHP 5.3 several useful default exceptions? (note that InvalidArgumentException, RuntimeException and LogicException exists since PHP 5.1) /** * The exception that is thrown when the value of an argument is * outside the allowable range of values as defined by the invoked method. */ class ArgumentOutOfRangeException extends InvalidArgumentException {} /** * The exception that is thrown when a method call is invalid for the object's * current state, method has been invoked at an illegal or inappropriate time. */ class InvalidStateException extends RuntimeException {} /** * The exception that is thrown when a requested method or operation is not implemented. */ class NotImplementedException extends LogicException {} /** * The exception that is thrown when a requested method or operation is deprecated. */ class DeprecatedException extends LogicException {} /** * The exception that is thrown when an invoked method is not supported. For scenarios where * it is sometimes possible to perform the requested operation, see InvalidStateException. */ class NotSupportedException extends LogicException {} /** * The exception that is thrown when an I/O error occurs. */ class IOException extends RuntimeException {} /** * The exception that is thrown when accessing a file that does not exist on disk. */ class FileNotFoundException extends IOException {} /** * The exception that is thrown when part of a file or directory cannot be found. */ class DirectoryNotFoundException extends IOException {} And the last one (this is something like BadMethodException, but for properties) /** * The exception that is thrown when accessing a class member (property or method) fails. */ class MemberAccessException extends LogicException {} David Grudl