Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77002 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50419 invoked from network); 1 Sep 2014 03:56:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Sep 2014 03:56:31 -0000 Authentication-Results: pb1.pair.com header.from=laruence@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=xinchen.h@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.217.169 as permitted sender) X-PHP-List-Original-Sender: xinchen.h@zend.com X-Host-Fingerprint: 209.85.217.169 mail-lb0-f169.google.com Received: from [209.85.217.169] ([209.85.217.169:43498] helo=mail-lb0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 89/10-48532-D6EE3045 for ; Sun, 31 Aug 2014 23:56:30 -0400 Received: by mail-lb0-f169.google.com with SMTP id l4so5254168lbv.14 for ; Sun, 31 Aug 2014 20:56:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=2od9iBgnRdPW+GfMWBgzl1yi4x+FDxAjMBh19xEu91Q=; b=b4fhLYZPUe30nqyPcw6x4tTaQHXjsg7YcLVjWVNuWnzRpXuzQHLHysqWtGzLsgSicp zW5dy8LYkGT+RuYcOoVRWJtBk9M0utXoP5DYK+LICQ8B6bqWlI/I28pQOOYacnVgC3tf 6FTGLrxlRM+i/Y4FqQf3wsat9pxtpubvpd++UGj9JEo2NCSbIoq/xPn5A9vilbG6D3D5 Ey6bsv/ebQhd5aKOschvzBq+dxAQshC8U+SfHeXn/lcdEc4ejyAhzs0kjsVOAZZiUQYR +wvEly3aVRBQyxiaygiiNMpEJj5zCJ07q/rydn0dpR2hC7r9BskWk9b2veFIaNNy/HZb uWsA== X-Gm-Message-State: ALoCoQnBeXrkBzrwfF2PqI/NUnsRXu/1bCV+M+uLezKXJhmKa83i/748CpqpfuOWKb0CSgIxa76T5yX6jy7DEme4J4P1J9FVo84xB0ikLjZIrmEcZB9DMIi8ikgbnCjMJY+RfSM/uCORzzKwWTKQUY9sqWSCgZ3vow== X-Received: by 10.112.35.138 with SMTP id h10mr23597888lbj.65.1409543786835; Sun, 31 Aug 2014 20:56:26 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com [209.85.215.52]) by mx.google.com with ESMTPSA id m1sm11204893lbc.49.2014.08.31.20.56.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 31 Aug 2014 20:56:25 -0700 (PDT) Received: by mail-la0-f52.google.com with SMTP id ty20so5430970lab.11 for ; Sun, 31 Aug 2014 20:56:24 -0700 (PDT) X-Received: by 10.152.21.168 with SMTP id w8mr11099077lae.53.1409543784836; Sun, 31 Aug 2014 20:56:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.114.187.72 with HTTP; Sun, 31 Aug 2014 20:56:04 -0700 (PDT) In-Reply-To: References: Date: Mon, 1 Sep 2014 11:56:04 +0800 Message-ID: To: Andrea Faulds Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Make zend_parse_parameters emit E_RECOVERABLE_ERROR From: laruence@php.net (Xinchen Hui) On Mon, Sep 1, 2014 at 6:01 AM, Andrea Faulds wrote: > Good evening, > > Here=E2=80=99s a suggestion: Why don=E2=80=99t we make zend_parse_paramet= ers emit ""Why not" is usually not a very good reason for a change in the language syntax. " -- Stas > E_RECOVERABLE_ERROR on failure, rather than just emitting E_WARNING and > returning FAILURE (causing the caller to typically bail out and return NU= LL)? > 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=E2=80=99s worth noting that > zend_parse_parameters is very tolerant in terms of what parameters you ca= n pass > it and is unlikely to error unless you do something really weird such as > passing an array to strlen(). PHP is a looser type language... such things might be happened. and internal functions always check their arguments. this will make the PHP app more robust. > I doubt this would affect backwards compatibility > much, unless your application relies on a silenced warning (which is poss= ible, > but discouraged behaviour), and it=E2=80=99s the type of BC break that wo= uld be really > obvious (your application errors and stops execution). that will be a nightmare to stop people upgrade their PHP. thanks > > Thoughts? > -- > Andrea Faulds > http://ajf.me/ > > > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > --=20 Xinchen Hui @Laruence http://www.laruence.com/