Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62611 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44063 invoked from network); 31 Aug 2012 17:03:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Aug 2012 17:03:20 -0000 Authentication-Results: pb1.pair.com header.from=ircmaxell@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ircmaxell@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.42 as permitted sender) X-PHP-List-Original-Sender: ircmaxell@gmail.com X-Host-Fingerprint: 209.85.215.42 mail-lpp01m010-f42.google.com Received: from [209.85.215.42] ([209.85.215.42:37694] helo=mail-lpp01m010-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1B/31-37167-65EE0405 for ; Fri, 31 Aug 2012 13:03:19 -0400 Received: by lahl5 with SMTP id l5so2447428lah.29 for ; Fri, 31 Aug 2012 10:03:16 -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=AlDKSxDkrno6VekX+Ys8uhb4sc5uiPAOVWZe+xcXCF0=; b=rBgAjrkcC8MQLz/Mw0VGlWMeNYBUqvmyaj8BrSH/u11rUo8dhb8uSmr+YOSDdKS8K2 oKRU4O+FoGMwCjatB8M953sltMl+QKuBeRPL9fXylBv6Ofk+KsM/hX97o90ZVFnT0Bdq 5X+cLfvNw1Dx4kwjDtohtuoSrIxrmPShS6zGXoXrIx+oONpGEMaxLUYG4CRZhu0r6kFM SnPplfcHcN7b9RM4YjjjoZjpaEVXukwUIsHw4NNOFF44vodMPl4M3h6xLx5XQ7OI+pis XPKV1Bx+IbMje+mwvjWHxA7MXb5v80UDT9ivkC556K7eRaIiXxcAR6S8kgCK9pbu+Eb+ sSSQ== MIME-Version: 1.0 Received: by 10.152.124.180 with SMTP id mj20mr7136638lab.43.1346432595903; Fri, 31 Aug 2012 10:03:15 -0700 (PDT) Received: by 10.114.22.1 with HTTP; Fri, 31 Aug 2012 10:03:15 -0700 (PDT) In-Reply-To: References: <5040DC47.8000305@ajf.me> Date: Fri, 31 Aug 2012 13:03:15 -0400 Message-ID: To: Ferenc Kovacs Cc: Andrew Faulds , PHP Internals Content-Type: multipart/alternative; boundary=f46d0434bfde97c35204c892c439 Subject: Re: [PHP-DEV] Re: Are exceptions allowed in php core? From: ircmaxell@gmail.com (Anthony Ferrara) --f46d0434bfde97c35204c892c439 Content-Type: text/plain; charset=ISO-8859-1 Ferenc, >> Not for PHP 5.5 (if that's happening?), but for PHP 6 I think a lot of > > things should become exceptions. > > > From the impression that I get from reading through the mailing list > threads and the irc discussions I think that there aren't that many things > that could turn into exceptions. > E_RECOVERABLE_ERROR and probably that's it. Actually, from my look at it, almost all E_WARNINGs, a number of E_NOTICEs (the ones that make sense to transition, like array to string cast), E_RECOVERABLE and certain E_ERROR (such as call to undefined method, etc) can be turned pretty easily. The ones that can't (without significant change to the engine at least) are deeper E_ERROR, E_CORE_*, and E_PARSE... Take a look at the library I am linking to deeper down. All of those errors are core thrown errors that can be easily turned into exceptions. Plus the E_ERROR that I couldn't, but we can in core (again, call to undefined method, etc)... > > I don't think that, personally, PHP's current error handling system is > > sufficient for properly handling errors. > > > It is working for years, it could be improved but I wouldn't call it > insufficient. Any system where it's **harder** to handle the error properly than to ignore it is insufficient in my book. The fact that you need something like this: https://github.com/ircmaxell/ErrorExceptions to handle errors properly as exceptions (to be notified not that an error occured, but the type of error) is indicative of that... Anthony --f46d0434bfde97c35204c892c439--