Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45072 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92734 invoked from network); 24 Jul 2009 13:40:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jul 2009 13:40:35 -0000 Authentication-Results: pb1.pair.com smtp.mail=kalle.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kalle.php@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 72.14.220.159 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: kalle.php@gmail.com X-Host-Fingerprint: 72.14.220.159 fg-out-1718.google.com Received: from [72.14.220.159] ([72.14.220.159:20365] helo=fg-out-1718.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 40/1A-39659-2D9B96A4 for ; Fri, 24 Jul 2009 09:40:35 -0400 Received: by fg-out-1718.google.com with SMTP id e12so447073fga.0 for ; Fri, 24 Jul 2009 06:40:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=FiW/nwNia8TCpAC5ZkQXc/C6UEwVGSPGsboqil8tPOo=; b=san6HO6tFgyPq4X9tP31e08Jjrc3i4Jdy0DB+Jm9tk7W4rlx9+mWgzDxLFb8MXwinn hUgr4+zSG4Y64YKbuaz5IKWjUs6oZDQqySvC/OEekYj7Hx9eGE1P0CAYrbG0irTnsBFj TkMdToB3wOkz6BmlZ7MGozFvKfobF4y4wv6AU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=yFxnB+t3J1L4eQmZWIupqvnXWSmleL3CM9Dcj48iLD7EAu08rhu7NCXLa/M/GcZsKK bA3pXH1r+cxFHWzVl0uoFseeI/npILJ3zvNbPa5T5AeOGN+OmfDcLaJnp1wXz6YTYDJX shZZBad290qd5YBIHIeKpU7LIGPoK5EfixtRM= MIME-Version: 1.0 Sender: kalle.php@gmail.com Received: by 10.86.25.10 with SMTP id 10mr3013842fgy.44.1248442829160; Fri, 24 Jul 2009 06:40:29 -0700 (PDT) In-Reply-To: References: Date: Fri, 24 Jul 2009 15:40:29 +0200 X-Google-Sender-Auth: 3e315951b749f9e5 Message-ID: <2dedb8a0907240640i118d220fte7ed4e0285aae024@mail.gmail.com> To: mail@dasprids.de Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] RFC: Replacing errors with Exceptions From: kalle@php.net (Kalle Sommer Nielsen) 2009/7/24 : > I published a (work in progress) RFC today about replacing certain > errors with exceptions. I know that there already was something similiar > on the php6dev blog, but this is not completly the same, so awating your > comments: > > http://wiki.php.net/rfc/errors_as_exceptions > I'm a big -1, I don't see a big reason for wrapping all my code in a try/catch block when im writing flat out procedural for example, PHP isn't an OO-only language, if you need to catch such errors via exceptions you can simply do it by having a custom error handler and the ErrorException as you linked to, like: set_error_handler(function($severity, $message, $file = NULL, $line = NULL, $context = NULL) { if(!(error_reporting() & $severity)) { return; } throw new ErrorException($message, 0, $severity, $file, $line, $context); }); I don't know if PHP should adopt code into the core that can be done in less than 10 lines, however with an ini setting it might work as long its off by default, but I'm not sure how many others here are happy about adding another ini setting for this. ps. Fix your email when posting -- regrads, Kalle Sommer Nielsen kalle@php.net