Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69648 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11508 invoked from network); 17 Oct 2013 17:54:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Oct 2013 17:54:33 -0000 Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.215.10 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.215.10 mail.experimentalworks.net Received: from [217.114.215.10] ([217.114.215.10:52905] helo=mail.experimentalworks.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6B/A4-12663-85420625 for ; Thu, 17 Oct 2013 13:54:33 -0400 Received: from [192.168.2.20] (ppp-88-217-72-240.dynamic.mnet-online.de [88.217.72.240]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: johannes@schlueters.de) by mail.experimentalworks.net (Postfix) with ESMTPSA id 79283401F7; Thu, 17 Oct 2013 19:54:42 +0200 (CEST) To: Benjamin Schneider Cc: internals@lists.php.net In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Date: Thu, 17 Oct 2013 19:54:19 +0200 Message-ID: <1382032459.3980.276.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Proposal: Introduction of InvalidStateException From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Thu, 2013-10-17 at 15:30 +0200, Benjamin Schneider wrote: > Hello, > > I would like to propose the introduction of an 'InvalidStateException' > into the SPL extension. Within the existing exceptions I am not able > to find a type that would represent a state error, throwable if a > method has been invoked at an illegal or inappropriate time. > > I would be able to write the RFC and later on implement this new > exception by myself, in case people share my opinion. I'm a strong believer in "what hasn't to be in core should not be" and these exceptions can easily be implemented in PHP. They have to be in C when internal things should throw those. True, doing this in PHP outside the core won't make those available everywhere, but I believe that doing this in userland allows to simplify adoption to changing needs in longterm and tools like Composer make it possible to distribute even such small libraries in a good way with way less trouble than a few years back. johannes