Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77001 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39509 invoked from network); 31 Aug 2014 22:01:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Aug 2014 22:01:50 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.207 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.207 imap2-2.ox.privateemail.com Received: from [192.64.116.207] ([192.64.116.207:41452] helo=imap2-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 64/00-38934-C4B93045 for ; Sun, 31 Aug 2014 18:01:49 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 17A728C0081 for ; Sun, 31 Aug 2014 18:01:45 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap2.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap2.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id AV3oJrY4Zrie for ; Sun, 31 Aug 2014 18:01:44 -0400 (EDT) Received: from [192.168.0.2] (05439dda.skybroadband.com [5.67.157.218]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 0DA4F8C007B for ; Sun, 31 Aug 2014 18:01:43 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Message-ID: Date: Sun, 31 Aug 2014 23:01:39 +0100 To: PHP Internals Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) X-Mailer: Apple Mail (2.1878.6) Subject: Make zend_parse_parameters emit E_RECOVERABLE_ERROR From: ajf@ajf.me (Andrea Faulds) Good evening, Here=92s a suggestion: Why don=92t we make zend_parse_parameters emit E_RECOVERABLE_ERROR on failure, rather than just emitting E_WARNING and returning FAILURE (causing the caller to typically bail out and return = NULL)? This would bring it into line with userland type hints, which also cause = such errors. It might also cause errors to be caught sooner, as just = returning NULL can cause cryptic problems down the line. It=92s worth noting that zend_parse_parameters is very tolerant in terms of what parameters you = can pass it and is unlikely to error unless you do something really weird such as passing an array to strlen(). I doubt this would affect backwards = compatibility much, unless your application relies on a silenced warning (which is = possible, but discouraged behaviour), and it=92s the type of BC break that would = be really obvious (your application errors and stops execution). Thoughts? -- Andrea Faulds http://ajf.me/