Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51895 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36566 invoked from network); 14 Apr 2011 13:06:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Apr 2011 13:06:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.214.42 mail-bw0-f42.google.com Received: from [209.85.214.42] ([209.85.214.42:59266] helo=mail-bw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F3/81-25347-741F6AD4 for ; Thu, 14 Apr 2011 09:06:17 -0400 Received: by bwz18 with SMTP id 18so1504466bwz.29 for ; Thu, 14 Apr 2011 06:06:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=L3Cbwq15tnQ+VyZmB+pxDwJUDhIWML6df90HCOluip8=; b=MG24YBHraar/2yTSm8qZx8oX8ZiqRr2P+uIiFEI3+yuXW+Gdkdvb7Fp/xubJdz37tw J2MSG3ogz84WzahQDJNJCyhNTqWsDFdeEGKrAVqk4OWrgTknRZuQudmN9OTkPyfcH+AL 3nqHBZ0VSzCM4kFaEIcUuTysWyxHIGsFpMdeE= 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:content-type; b=cSgqRFdgPWRFb6ZaroEa0A7aC19aMjxm8jaNOKAWjwKHLLBeRazR+Qf/wk1h5E76Pc NZZ/NbU7A0Y29ivV1oDXgFWlGq2i+LRFAkhPw+wkdQjQnLs0mNPcPOEgan6/s/vYRlvS OhVEqHbssk7pBm3iFNmIQmo/DZTsubyM9pkNg= MIME-Version: 1.0 Received: by 10.204.19.16 with SMTP id y16mr542282bka.186.1302786372821; Thu, 14 Apr 2011 06:06:12 -0700 (PDT) Sender: tyra3l@gmail.com Received: by 10.205.83.198 with HTTP; Thu, 14 Apr 2011 06:06:12 -0700 (PDT) In-Reply-To: <4DA6E4EB.9010005@gmail.com> References: <4D950434.3060704@yahoo.com.au> <4D9E0543.1080600@lerdorf.com> <69.82.36433.EC33E9D4@pb1.pair.com> <4D9E34C4.5000406@lerdorf.com> <4D9E429B.20503@sugarcrm.com> <4D9E96B6.6060401@lerdorf.com> <718216446.20110408143441@cypressintegrated.com> <4DA0E71C.9030008@gmail.com> <4DA63ED8.4080402@yahoo.com.au> <4DA65BEC.8000809@gmail.com> <4DA6E4EB.9010005@gmail.com> Date: Thu, 14 Apr 2011 15:06:12 +0200 X-Google-Sender-Auth: xzlcxEcBjE3f9zLEMbSHLIM3Hiw Message-ID: To: David Muir , PHP Internals Content-Type: multipart/alternative; boundary=0003255579b6f863c704a0e09643 Subject: Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator From: info@tyrael.hu (Ferenc Kovacs) --0003255579b6f863c704a0e09643 Content-Type: text/plain; charset=UTF-8 > > > I'm aware there are cases where @ still has to be used. What I meant was > that PHP should let you write clean code that doesn't require error > suppression, or require you to jump through hoops to avoid errors. I look > forward to the day when that might be possible. > > David > > > there will always be situations when an operation cannot be completed and it has to be reported somehow. currently a function can report the error multiple ways: - it can return false like mysql_query, and you can fetch the error with a different method. - it can return NULL, like json_decode (be aware that the NULL return can also mean success :/), and you can fetch the error with a different method. - it can return false and trigger an error/warning/notice like iconv. - it can throw an exception, like for example Spl and the Reflection stuff does. - it can do some of the above depending on some configuration option, this is what PDO::ERRMODE_* does for example. and what I forget to mention. :) and it sucks that currently you cannot do some things without making errors which are expensive, wether you collect the errors or not. :/ so I think that some reboot/refactor about the error/exception handling would be a really good thing, of course we can do such changes only in major or maybe with minor version bump. another thing would be to make the error/exception handlers to be truly stackable (so there would be possible to have more than one active handler, be them distinct or overlapping) and have the ability to set the class/interface when you set_exception_handler, just like you set it for catch statements. ps: that post went longer and more off-topic than I expected, maybe an it would be better as an RFC... Tyrael --0003255579b6f863c704a0e09643--