Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58784 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43583 invoked from network); 8 Mar 2012 13:41:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Mar 2012 13:41:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=ircmaxell@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ircmaxell@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.170 as permitted sender) X-PHP-List-Original-Sender: ircmaxell@gmail.com X-Host-Fingerprint: 209.85.216.170 mail-qy0-f170.google.com Received: from [209.85.216.170] ([209.85.216.170:48152] helo=mail-qy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CF/B7-00152-817B85F4 for ; Thu, 08 Mar 2012 08:41:44 -0500 Received: by qcmt36 with SMTP id t36so366605qcm.29 for ; Thu, 08 Mar 2012 05:41:41 -0800 (PST) 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=IqhylXa6ObEEH2pXo5qrIthW2y2DKgSlIevyCN1wwUI=; b=oUOrYbPBAYH8HOHfJFXBoMtBSNAEb+dfE05qJgCCEQK6VCDjBs4sHfAOIrhOAIEYIA sGncT8uk11l2kI+AjQGqUrME3604idt4RIM03i2azPRc8RqhBpCzVMkEVlVgI3wxGAnq IV5iBKq4LCgYGdLLP6KWffEtBlI9OxenP2FdhLfIljGsf1HHm3TPGBSN4f9EG1E2Bx0o ixgbe5t6ZIP6ya0WOy5H3+FDn2lnlS+jMBjNrBFylF7hC3N5TuvUOGZD1jHKIpecbZdt DvPWduZPauvkiD07LQu2wgNXU66QTnaEhSt/Zli1K2lnuHV/M5C2j2Uxh4eFChmw4jmQ EGgA== MIME-Version: 1.0 Received: by 10.229.135.141 with SMTP id n13mr1118287qct.25.1331214101674; Thu, 08 Mar 2012 05:41:41 -0800 (PST) Received: by 10.229.49.74 with HTTP; Thu, 8 Mar 2012 05:41:41 -0800 (PST) In-Reply-To: References: <52.38.15021.3A1E65F4@pb1.pair.com> <4F570EBB.6030103@sugarcrm.com> <60744d7ea642fe03c7110502a3f4276a@mohiva.com> Date: Thu, 8 Mar 2012 08:41:41 -0500 Message-ID: To: Gustavo Lopes Cc: Ferenc Kovacs , Arvids Godjuks , Simon Schick , internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Scalar Type Hinting From: ircmaxell@gmail.com (Anthony Ferrara) Gustavo, > Not really, that's just a convention that if zpp fails functions return null > or false immediately (which one is used depends on the extension, current > weather, etc.). That's because there's a convention that builtin functions > don't raise exceptions. But nothings stops them from falling back or > suppressing the warning/notice (and some do, esp. if they support distinct > sets of arguments). > > Some extensions (and constructors even in extensions that use false for > error) actually force an exception if zpp fails (usually via > zend_replace_error_handling). Quite fair... > But of course this is not an option in user code because: > 1) you can't change the error handling before parsing the parameters and > 2) inside the function you can't tell whether some argument parsing error > occurred. Which is the point. > So E_RECOVERABLE_ERROR in the cases where zpp would return FAILURE seems in > fact the only viable option, even with the disadvantages it has > (centralization and lack of flexibility). So, at that point, then it sounds like we have a spec. Functionality of zpp, with an E_RECOVERABLE_ERROR where zpp would fail. Including any warnings or notices that zpp would have raised anyway (since `"1abc" would work when passed to an int, it should still work, notice intact). > Still, the fact that 100% consistency is not possible is not a strong > argument against at least *some* consistency and in favor of inventing new > rules. Sure. Makes sense. I'll work on a proof-of-concept this weekend. That is if nobody else wants to take it (or beats me to it) :-D. Thanks, Anthony