Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95435 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99182 invoked from network); 24 Aug 2016 17:56:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Aug 2016 17:56:48 -0000 Authentication-Results: pb1.pair.com header.from=me@daveyshafik.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=me@daveyshafik.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain daveyshafik.com from 209.85.216.176 cause and error) X-PHP-List-Original-Sender: me@daveyshafik.com X-Host-Fingerprint: 209.85.216.176 mail-qt0-f176.google.com Received: from [209.85.216.176] ([209.85.216.176:33531] helo=mail-qt0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1E/4B-10212-FDFDDB75 for ; Wed, 24 Aug 2016 13:56:48 -0400 Received: by mail-qt0-f176.google.com with SMTP id w38so11253219qtb.0 for ; Wed, 24 Aug 2016 10:56:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daveyshafik-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=NYrfr42G4pz+3WTYjZwTqL7DVisrZ8Hw8yXs86Xs8tE=; b=XwzdPSWDcUsi2TWJTvHph9hmuuTVLrTdSohbjjhdf7VgEJM9x1NDI4Arw5w+/vX6l4 4v5M2ar9E0PV/4hBqexYZ1Uly1SlALdiwczRhov+qQ34uamhfUwpaZdZBKV9IBHtRQxa oQnkrEzsAigp+aWXwi2pFlRjivOv9WPbU3wGhVx+fnEJDDeMjUoZPlnQB95+y3kDFdob ogoONefCXLxTdOyjIbcXG5ICIKmZqvssryrr9RMSBsTZt0vwn1xhDyOorUJMjyLmvp0O wald0ZU5VwG4z3g3YlHqJo31QB+wv8ghf9krTnn7c3jBHpgGcqei4UzsylXrtSQGfcfq qFKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=NYrfr42G4pz+3WTYjZwTqL7DVisrZ8Hw8yXs86Xs8tE=; b=h7rmD/0W9lGg6i9O8gWHn9eHd1h1wi6MY7EEvUTQVIqxH8V1RunbQnS1wScktsa9nx f5nZbensdDTBQIKyboEcC/DHkvTQMCzY5rHBkTXZ5UCEwQ9A+0gJp2AFohS+rqe9wcVq ic6gs1gQ5qfbqGt2v0ErxAXBLb2ly9ue1SvgTYvH4jKavypNPdARF6N8zLEPybfH0LQe ZaxNHcvTjFajuekrg+rx1FKttc/cMVKbe2YQHOY9Zirzxd7ZPxGXIiuQU0zlf4FHo79q Xedc0P+TAhaO1sqSb/2py42kAI7gNISZT2sFYRhbIB0Wf5I8gbvqMSF7Q4kCeqwlax/z FMtA== X-Gm-Message-State: AE9vXwNS/Tiy8otFBFoRqUjx+lR3VAddqYcmlaEJROshrZ2IZG4t/eTCHqHEdxGiSvVAqQw+jygSFA6NSXaiLjnv X-Received: by 10.200.40.99 with SMTP id 32mr5089800qtr.97.1472061404551; Wed, 24 Aug 2016 10:56:44 -0700 (PDT) MIME-Version: 1.0 Sender: me@daveyshafik.com Received: by 10.237.55.138 with HTTP; Wed, 24 Aug 2016 10:56:44 -0700 (PDT) In-Reply-To: References: Date: Thu, 25 Aug 2016 01:56:44 +0800 X-Google-Sender-Auth: U-HahDjHs_j3OM9DK9H-B09Yn5U Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: multipart/alternative; boundary=001a1135b2821b3960053ad5017a Subject: Re: [PHP-DEV] Reverting "Too Few Arguments Exception" RFC From: davey@php.net (Davey Shafik) --001a1135b2821b3960053ad5017a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Nikita, It is _always_ better to have more specific exceptions when it makes sense. In this case, we need to do it to maintain BC. One use-case that wasn't covered in the RFC, is the use of argument unpacking with too few elements in the array/traversable =E2=80=94 whereby = you would want to guard specifically for this condition, and handle it in a non-generic way. WRT to the internal functions, you were the person to bring up the behavior of internal functions: > Problem: We already use TypeError for this for internal functions. If we want to introduce an extra exception for this, lets use it for internal functions as well. In that case we should probably go with something that applies not just to too few arguments, but also to too many. During which I noticed the discrepancy with the array functions. - Davey On Thu, Aug 25, 2016 at 12:45 AM, Nikita Popov wrote= : > On Aug 24, 2016 9:55 AM, "Davey Shafik" wrote: > > > > Hi all, > > > > Given this thread: http://externals.io/thread/233 > > > > I'm not happy with the state of this going into RC1 next week, and > without > > changes (such as the patch I provided), I would like to revert this > change > > and leave it for 7.2. > > > > My patch will _retain_ BC for internal functions with non strict_types > > (except for the error message, which can be reconciled), and for > functions > > that previously threw a TypeError, ArgumentCountError is a subclass so = BC > > is preserved there also. > > > > The issue is that the array functions that do this argument count > checking > > themselves and still issue a warning, regardless of strict_types. > > > > We can leave the original behavior for array functions, but they then > > differ from other internals functions. > > > > It is a BC break for userland functions (as per the RFC), throwing an > > ArgumentCountError regardless of strict_types. > > > > At this point, we _must_ come to consensus by Monday to get it into RC1 > (if > > there are changes needed) or we should remove it from 7.1. Also, I woul= d > > like someone more experienced to review my patch. > > > > - Davey > > I have some trouble understanding what the issue is here. The mentioned > RFC affects only userland functions, so the non-standard behavior of some > array functions shouldn't matter. > > Personally I am entirely indifferent as to what exception gets thrown whe= n > too little arguments are passed -- this is a type of error that should no= t > be caught by anything but catch-all handlers. > > Inability to provide a more specific exception should not be a blocker fo= r > this, especially as this is beyond the scope of the original RFC. > > Nikita > --001a1135b2821b3960053ad5017a--