Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82811 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66719 invoked from network); 16 Feb 2015 10:43:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Feb 2015 10:43:35 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.172 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.172 mail-wi0-f172.google.com Received: from [209.85.212.172] ([209.85.212.172:65204] helo=mail-wi0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id ED/4E-05176-6D9C1E45 for ; Mon, 16 Feb 2015 05:43:34 -0500 Received: by mail-wi0-f172.google.com with SMTP id l15so25016861wiw.5 for ; Mon, 16 Feb 2015 02:43:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=p7Wy7UOyH35M6TaZCekY4juer5jrERG+aBT2a4xobns=; b=isYurgrFFiMSSGnb9G82rkyF8rUq08SFkQqh2LXK9FKwoOVfiKulYSrAC0NyckwMeF f5cVxVO4lhUKdjpEYnPyRJ5/MxJKEvqj66a7pgy7VeyYZ+m3mmYpSoCWBqUJ/nVFpZ5h 40jU44q4GE+1rrB3qC9+3+rVjcPw4znHBgYS1Coul3/sBu8OQyCFG8b3N23kfKufSzqU dhD7Fs/SuEdvFcYwT5weZa1j7MspTrwjgBX/XhBPuxZpguiKgf1oOwsIoPAYoD0pXIDG 5DRQ4njVFV7HyVc0kNKDh11Z6oqTOxrpuqCfaR5LiVAocmVKj8zZl/P+ZEswLHpvoLdm uEZw== X-Received: by 10.180.103.102 with SMTP id fv6mr44001839wib.80.1424083410823; Mon, 16 Feb 2015 02:43:30 -0800 (PST) Received: from [192.168.0.172] ([62.189.198.114]) by mx.google.com with ESMTPSA id dm6sm19067410wib.22.2015.02.16.02.43.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Feb 2015 02:43:30 -0800 (PST) Message-ID: <54E1C993.1070609@gmail.com> Date: Mon, 16 Feb 2015 10:42:27 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: internals@lists.php.net References: <54E12349.7070806@gmail.com> <16.9B.05176.AE1C1E45@pb1.pair.com> In-Reply-To: <16.9B.05176.AE1C1E45@pb1.pair.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Exceptions in the engine From: rowan.collins@gmail.com (Rowan Collins) Tony Marston wrote on 16/02/2015 10:09: > This RFC only mentions errors with object methods, so what impact > would it have with procedural functions. For example, if > fopen('nonexistantfile.txt') fails the return value is FALSE and an > E_WARNING is generated, but it is difficult to trap the error message > (it could be a permissions error, for example). Is there any plan to > convert procedural functions to throw exceptions? As Nikita already said: > This RFC is strictly about fatal and recoverable fatal errors. Changing any > other error types to exceptions would be a significant > backwards-compatibility break. So, no, since that's currently an E_WARNING, there is no current plan to change that case to an exception. If we were writing fopen() from scratch now, it might be worth considering, but the BC implications of changing something from non-fatal to fatal are rather drastic. That has absolutely nothing to do with OO vs procedural code, though. A procedural function could well have an error condition which should be fatal if unhandled, but can usefully be caught somewhere up the stack, which is basically what an exception is for. Any procedural function which currently issues an E_ERROR or E_RECOVERABLE_ERROR is a candidate to be converted under the current RFC. Regards, -- Rowan Collins [IMSoP]