Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78906 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18952 invoked from network); 14 Nov 2014 11:32:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Nov 2014 11:32:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.208 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.208 imap2-3.ox.privateemail.com Received: from [192.64.116.208] ([192.64.116.208:48756] helo=imap2-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6A/09-07200-058E5645 for ; Fri, 14 Nov 2014 06:32:33 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id D51AA8C0081; Fri, 14 Nov 2014 06:32:29 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap2.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap2.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id FITek3CQKQSD; Fri, 14 Nov 2014 06:32:29 -0500 (EST) Received: from oa-res-27-29.wireless.abdn.ac.uk (oa-res-27-29.wireless.abdn.ac.uk [137.50.27.29]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 345AF8C007B; Fri, 14 Nov 2014 06:32:29 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) In-Reply-To: Date: Fri, 14 Nov 2014 11:32:27 +0000 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <2D612216-1942-47F3-A84D-7301BB1A4CB8@ajf.me> References: To: "Mathieu D." X-Mailer: Apple Mail (2.1990.1) Subject: Re: [PHP-DEV] Extend bundled exceptions From: ajf@ajf.me (Andrea Faulds) > On 14 Nov 2014, at 07:39, Mathieu D. wrote: >=20 > PHP is lacking of some elemental exceptions. One obvious example would = be > FileNotFoundException. >=20 > Java has a FileNotFoundException, > C# has a FileNotFoundException, > Python has a FileNotFoundError, ... >=20 > Why doesn't PHP provide a bundled FileNotFoundException or at least a = more > general IOException? Presumably this is because most of PHP=E2=80=99s I/O stuff still uses = procedural APIs with error return values. One of the things I=E2=80=99d like to see happen, but don=E2=80=99t have = the time to do myself, is get rid of the IS_RESOURCE type from PHP for = PHP 7, and replace all instances with objects. As part of this, we=E2=80=99= d need to convert streams to using objects, which would give us an = opportunity to create a new OOP stream API, learning from our past = mistakes and which uses exceptions. As part of that, I=E2=80=99m sure = we=E2=80=99d add some I/O exceptions. -- Andrea Faulds http://ajf.me/