Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62060 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2543 invoked from network); 6 Aug 2012 04:33:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Aug 2012 04:33:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; 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: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.215.42 mail-lpp01m010-f42.google.com Received: from [209.85.215.42] ([209.85.215.42:33229] helo=mail-lpp01m010-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 67/75-03102-D194F105 for ; Mon, 06 Aug 2012 00:33:34 -0400 Received: by lago2 with SMTP id o2so1402781lag.29 for ; Sun, 05 Aug 2012 21:33:30 -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=nolPvajqKs6P/As8J2A3L8ajqGuuleIWkZ2ly5Ucqd0=; b=L56suRuMTYyr/hkvyTPTv81T/UQTooC2iYYAFxhh52Wba+AxOjqkxYiulmssCwZ19o jBOPZk4+CseuWQcGY8w+WyOMEMYss1pdR2lnF8rwtIc2TV93dgjGqCXvQwCdXDPyv+eq VSaU6AocMQvwFplyLZqPNYU0IaXFow9RuIcLm23CRnD62kP+0Tsf66t9LkH/DcjuNQet De6IRGSvdxIBfN2y3G7uAoSnrUDq4SdBPyfzStssjJwbMbwtH70PNgHed3U1iYAkQTIL pKgmAMMFtYnaNSSuG8SPMvr6PL83kr34ijdThBwh/nyzaMtIDtPc9Eo84JtWQcNyLWIG gzXg== MIME-Version: 1.0 Received: by 10.112.42.164 with SMTP id p4mr3997472lbl.54.1344227610866; Sun, 05 Aug 2012 21:33:30 -0700 (PDT) Received: by 10.112.1.199 with HTTP; Sun, 5 Aug 2012 21:33:30 -0700 (PDT) In-Reply-To: <501F46BE.4040407@sugarcrm.com> References: <501F46BE.4040407@sugarcrm.com> Date: Sun, 5 Aug 2012 22:33:30 -0600 Message-ID: To: Stas Malyshev Cc: Ferenc Kovacs , PHP Internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Error handling brainstorming From: morrison.levi@gmail.com (Levi Morrison) > . . .For example, if you try to > open a file and the file isn't there, throwing exception is a very > annoying behavior (yes I know some languages do that, IMO it's wrong). Because checking that the returned variable is `!== FALSE` is *way* better than throwing an exception, right? This type of thing is one of the main reasons I like PDO more than MySQLi. In MySQLi I'm constantly checking return values. In PDO I just wrap it all up one try/catch. It's not like if my query fails I'm going to try a different one. Most of the time it's just logging that something went wrong and reporting it upstream somehow. I understand that opening a file is a bit different than querying a database, but I have to disagree with your entire previous post. Exceptions are much nicer than errors. Of course, everyone is entitled to have and express their own opinion. I'm just sharing mine.