Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45082 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30295 invoked from network); 24 Jul 2009 16:32:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jul 2009 16:32:33 -0000 Authentication-Results: pb1.pair.com header.from=chrisstocktonaz@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=chrisstocktonaz@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.210.203 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: chrisstocktonaz@gmail.com X-Host-Fingerprint: 209.85.210.203 mail-yx0-f203.google.com Received: from [209.85.210.203] ([209.85.210.203:41323] helo=mail-yx0-f203.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C0/D1-39659-022E96A4 for ; Fri, 24 Jul 2009 12:32:33 -0400 Received: by yxe41 with SMTP id 41so730590yxe.29 for ; Fri, 24 Jul 2009 09:32:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=06cWZCn6HS783Hqs+pc1MZt5IeX+OAapTUvUZsDCgJE=; b=V9/zMOAzEgy3LKuU/I/3s/kiMtAn5ttgea1aN2lC9rSsmMuEOD1O1L+Ftu2U7xfCKo SN+YsPLd4x0zvxWuUzpLY/EdyjkOayahQ9xcK2Wo8QeWVqN0oP/MTrn8YghPpSCBfWs7 27gA14LcVlnogKnw+FwW6DuufKzM9kRIFvrrQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=sfnsMEyhLqKvnxNLPQNc1xyvdojLKtE4tQlSQ5IDPvYh+1xMf/Fc6R8h9A6YfI0hWC 86gvCJQFswCsWqDg4JdRWArfh/M+MdNI/cMhUXF5zrbwpq5c3bw6SH/G9YkOF6Neey+5 5+5v38zfTz8YHTkShesC2CGKNZjBncJS8PG2k= MIME-Version: 1.0 Received: by 10.150.217.7 with SMTP id p7mr5794995ybg.268.1248453149413; Fri, 24 Jul 2009 09:32:29 -0700 (PDT) In-Reply-To: References: <2dedb8a0907240640i118d220fte7ed4e0285aae024@mail.gmail.com> <4A69D866.9010108@moonspot.net> Date: Fri, 24 Jul 2009 09:32:29 -0700 Message-ID: To: Matt Wilson Cc: Brian Moon , internals@lists.php.net, "Ben Scholzen 'DASPRiD'" Content-Type: multipart/alternative; boundary=000e0cd3eb827d5261046f762691 Subject: Re: [PHP-DEV] RFC: Replacing errors with Exceptions From: chrisstocktonaz@gmail.com (Chris Stockton) --000e0cd3eb827d5261046f762691 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sorry for top post, on my android. I disagree that php has perl phobia, but I agree that a alternative to errors needs to be made. Your example is nice but might have some tricky implementation details if php continued to throw errors when it didn't detect $!. I.E. fopen(...) or throw new CustomException($!); when custom exception writes to a log file that also writes to $! Perhaps for file not found, For example, does the first fopen throw the error or supress it as the user likely wanted. However it becomes a moot point if errors are still thrown. On Jul 24, 2009 9:01 AM, "Matt Wilson" wrote: I agree, however there are certain aspects of PHP's errors that leave a lot to be desired. For instance, a failed fopen or a failed socket will often result in an uncatchable warning from php. Sure, you can add a @ to the line but that's slow and doesn't tell you anything about what happened. I've been saying for years that PHP needs to get over its perl phobia and implement something like $! fopen("file", "r") or throw new Exception("Error: ". $!); Wouldn't that be nice? On Jul 24, 2009, at 10:51 AM, Brian Moon wrote: > On 7/24/09 6:43 AM, Ben Scholzen 'DASPRiD' wrot... --000e0cd3eb827d5261046f762691--