Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69649 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13281 invoked from network); 17 Oct 2013 18:01:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Oct 2013 18:01:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.48 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.219.48 mail-oa0-f48.google.com Received: from [209.85.219.48] ([209.85.219.48:39389] helo=mail-oa0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C3/05-12663-DE520625 for ; Thu, 17 Oct 2013 14:01:17 -0400 Received: by mail-oa0-f48.google.com with SMTP id m17so1940462oag.35 for ; Thu, 17 Oct 2013 11:01:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=SfyuVD+NiQMcVZwNTz8nLtR7At3FNvOEiA3RLd5rH8k=; b=KpVBAjHLHc1GQmuVnkOl1UAmA0QW7C1Md5LuJomCXAEUfXeGgJqCbjweffvHDvK5Qn xKQj/BO5gLDc9V7WBS7vC9WROogsXYeVGZ+gbDUYGVNvoNAJC2KS+FRJlz576Jzxr5NN CJJPU7TYx1YLI0/EHt69BGMlTksku6Xu2e1+3xbL735WfFofeUrCz5CJAOsQxAKK9oFz 04ZDG/W475aucXE0k+MBHG3B92/iYw06D2zcRdsZ4ZBXDSNhY0gcdC+hQKuXkxkGGh6y NMY6bxPBJ6SzC1+prQUm1NdqIy500iTn9rEfkMwy24YbgdGQbWdNlbuYzto/Dmdo/ics QwWw== MIME-Version: 1.0 X-Received: by 10.182.247.68 with SMTP id yc4mr3468694obc.67.1382032874613; Thu, 17 Oct 2013 11:01:14 -0700 (PDT) Received: by 10.76.12.135 with HTTP; Thu, 17 Oct 2013 11:01:14 -0700 (PDT) In-Reply-To: <1382032459.3980.276.camel@guybrush> References: <1382032459.3980.276.camel@guybrush> Date: Thu, 17 Oct 2013 12:01:14 -0600 Message-ID: To: =?ISO-8859-1?Q?Johannes_Schl=FCter?= Cc: Benjamin Schneider , internals Content-Type: multipart/alternative; boundary=089e015384d68f35bc04e8f39af0 Subject: Re: [PHP-DEV] Proposal: Introduction of InvalidStateException From: morrison.levi@gmail.com (Levi Morrison) --089e015384d68f35bc04e8f39af0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Thu, Oct 17, 2013 at 11:54 AM, Johannes Schl=FCter wrote: > 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. I agree, Johannes. However, there are actually times where the SPL should internally throw these exceptions. A work-in-progress can be at found https://github.com/morrisonlevi/php-src/tree/StateExceptions. There are actually way more use-cases for StateException than I originally believed. --089e015384d68f35bc04e8f39af0--