Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62016 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92239 invoked from network); 3 Aug 2012 16:42:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Aug 2012 16:42:07 -0000 Authentication-Results: pb1.pair.com header.from=sv_forums@fmethod.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=sv_forums@fmethod.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fmethod.com from 74.125.83.42 cause and error) X-PHP-List-Original-Sender: sv_forums@fmethod.com X-Host-Fingerprint: 74.125.83.42 mail-ee0-f42.google.com Received: from [74.125.83.42] ([74.125.83.42:56723] helo=mail-ee0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C8/80-23476-E5FFB105 for ; Fri, 03 Aug 2012 12:42:07 -0400 Received: by eekb15 with SMTP id b15so269483eek.29 for ; Fri, 03 Aug 2012 09:42:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:from:to:cc:references:subject:date:mime-version :content-type:x-priority:x-msmail-priority:x-mailer:x-mimeole :x-gm-message-state; bh=iTB/OKxyHbEO6eEUfuToczpVzrs0MqYOsHENHWDPzv4=; b=ULpxmkUMRm6sHF+JWcb03cRfKKcCp7Z9CAqeSaAyqmfPRm83u0TwZtibs2mkFJicUG paXL9A7IgZjC//welEW9juNjqCA6h5dQNTwfJZBQLTLv3Bhu8kbFzp4oHx+a5kF/qjuw oFkiiCO9LL5hrQtG5TGsa8Cd0QoWueHp+pnn0cnXLvVXvpmsvW+4tACvI7BWUwMk6Ymn LcJwr5gHXERI40D3s9vtMpRpZAMi5cg/aOSj/ZaWX0sUknRgQMU7upWuRNWZO2uZ9d36 QKKlCMhw9BsOI7T0OsoOPj+zadyHObbH9+JRFJt9KZw3lcBjEtgnXIf10tanHipRzCul NTWw== Received: by 10.14.182.134 with SMTP id o6mr2877244eem.26.1344012123922; Fri, 03 Aug 2012 09:42:03 -0700 (PDT) Received: from pc (87-126-4-134.btc-net.bg. [87.126.4.134]) by mx.google.com with ESMTPS id w5sm27081755eeo.1.2012.08.03.09.42.02 (version=SSLv3 cipher=OTHER); Fri, 03 Aug 2012 09:42:03 -0700 (PDT) Message-ID: <1AC58F6F21EA4A25986DCE95414C8142@pc> To: "Ferenc Kovacs" , "Andrew Faulds" Cc: "Leigh" , References: <3F2B7A4F937D4FA9A1CE88818CBCEB1D@pc><501BF3B7.9020304@ajf.me> Date: Fri, 3 Aug 2012 19:42:00 +0300 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0055_01CD71B0.0CAB7B40" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Gm-Message-State: ALoCoQmy1ZBmFm8rUH2Wc+1O6HGnSlvub9pq/TtiT8JEt4XA2Qf3Tl59jktGrUKFrE4pM98b+/3I Subject: Re: [PHP-DEV] Why do disabled functions / classes generate a WARNING. From: sv_forums@fmethod.com ("Stan Vass") ------=_NextPart_000_0055_01CD71B0.0CAB7B40 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Which brings up the issues that I mentioned before. Getting the return of an erroring function isn't such a big issue, but = turning everything into exceptions would prevent getting any return = value from any function/operation which triggers anything, Maybe you want to keep your cake and eat it too, but in practice, = functions which return useful content and also error are simply poorly = designed. You can work around such function, for example if I absolutely need both = channels, exception AND return value, I have this: 1) switch the error handler in a temporary mode which logs errors in an = array without throwing them. 2) call the offending function 3) preserve the return value and read the log 4) create an exception class instance which contains all needed data 5) throw it. Alternatively I can choose to just return the value and not throw = anything, depends what makes most sense. I wrap this once and then I can = call it just as usual, getting both channels. BUT, this is very rare, = and is a sign of a poor design of the function IMHO. Stan ------=_NextPart_000_0055_01CD71B0.0CAB7B40--