Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105128 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 7540 invoked from network); 7 Apr 2019 13:25:15 -0000 Received: from unknown (HELO mail-wr1-f68.google.com) (209.85.221.68) by pb1.pair.com with SMTP; 7 Apr 2019 13:25:15 -0000 Received: by mail-wr1-f68.google.com with SMTP id y13so12891935wrd.3 for ; Sun, 07 Apr 2019 03:21:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=saJ5Iwegbr2RYiZ46PpdmbXlUbJCXtYxtFkjR3ejsUQ=; b=Tl6+Na7iKyUsxKmwFwFaRxTq1Nmpc5+iYfSgv/wvGnKHkG0JKhVp268pw4qiGcVBOo 3L+qbMacd2WhEzcENx68uH3BtFZpBIhpFZvnLQaYKl/6njHp/kpU5c05K0/9al6wjDcR KoTUiMXa9Pwqdmb13CM57fkVa6As/89qC6n3oqQPlRrOZBxiIpmXL+W+/BikdIBxDMMw 5dkXB3/YXC4kM7LPl2vgmd5U8yX28ywBCch9zvCFBhzorkqQuIbW/j/ay4eJK/aKv6yN axHJUDc7yLdXUH/3TGMymT7qo/ZvjKlk/CQI/5020nsZ0Hec2hOd9YdkDsrX/OUcFWzK f4Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=saJ5Iwegbr2RYiZ46PpdmbXlUbJCXtYxtFkjR3ejsUQ=; b=gMIHUPp5tquu15g3tGOQDSnFUg4NJ4gWfCi0w4RTuQKKNpM6LdzeWGVBMZvvjFTxVQ pP6LT+QJh4s+4Ty5wiektD5bjHT/SAGUBDbMSMTWxOoFxDd/5jZyOrfEciDXcC/CvByp cblrZH/VYjICYq0aR1uGAtxqwu3w44z4HHE/qJY2NCr5mx0uwR2G3sHpU3tsRCTh7j6G ubZ2+ds6ilc95mbtYPrQLTm5IDrgqEGF+kWDuSHLL1XLmUDBRYqjcw4vify1zR+rizaO Z6x5Yn8ffhQYDU/EwuM2vHuuXqfYytQ8kwcz0NBZEjkZlVo0qEkxo5ruusNGnNDepb/e V0JQ== X-Gm-Message-State: APjAAAWfovMLRMTeE1mOkEQrCPmdd8pMYqm+n5ny9aOBK7WewQl1yCWM Qw1xS848dK16ANGR29IO5Zs= X-Google-Smtp-Source: APXvYqznE9YIw5Y1vrzurVVc+/WUuQWAIHSrA25hEInLu++EWjuR5PUf/UMoKlPFhisdA9urGhZqWg== X-Received: by 2002:adf:ee50:: with SMTP id w16mr14374325wro.293.1554632496684; Sun, 07 Apr 2019 03:21:36 -0700 (PDT) Received: from [10.140.27.11] ([185.174.184.98]) by smtp.gmail.com with ESMTPSA id d3sm20020552wmf.46.2019.04.07.03.21.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Apr 2019 03:21:35 -0700 (PDT) Message-ID: <96516724-154F-4C5E-B69D-F5C978D600A0@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_DC9D0944-97B1-43A1-A1F5-11E24A1309F7" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Date: Sun, 7 Apr 2019 12:21:35 +0200 In-Reply-To: Cc: Internals To: Craig Duncan References: <169f6751c80.27c1.08be835b7d1a2c2edb4c4286afe1a236@gmail.com> X-Mailer: Apple Mail (2.3445.104.8) Subject: Re: [PHP-DEV] Parameter skipping From: gadelat@gmail.com (Gabriel O) --Apple-Mail=_DC9D0944-97B1-43A1-A1F5-11E24A1309F7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I mean it=E2=80=99s easier than named parameters. I guess I replied to = wrong thread, but wanted to contrast =E2=80=9Cdefault=E2=80=9D with = JSON_DEFAULT_DEPTH. Accepting string in integer parameter just creates = mores issues. And please don=E2=80=99t use name conflicts as argument = for not adding something. It=E2=80=99s absurd to stop adding anything in = minor releases because name can conflict with userland, especially in = case name is prefixed like here. > On 7. Apr 2019, at 11:31, Craig Duncan wrote: >=20 > Hi Gabriel, do you mean a constant for every parameter's default = value? I'm not sure how that's easier, and it's technically worse for BC = as *default* is already a keyword but your new global constants could = clash with userland ones. >=20 >=20 >=20 > On Sun, 7 Apr 2019, 07:33 Gabriel O, > wrote: > Wouldn't better (and still easy and bc) solution be to just have = constant=20 > holding default value? >=20 > On 6 April 2019 11:16:02 PM Craig Duncan > wrote: >=20 > > Hi all, > > > > After starting to use https://wiki.php.net/rfc/json_throw_on_error = in PHP > > 7.3 I've encountered the annoying issue of having to pass the $depth > > parameter as 512 every time I want json_decode() to throw. > > > > After doing this a few times I remembered the parameter skipping RFC = that > > Stas proposed a few years ago: https://wiki.php.net/rfc/skipparams = > > > > I've re-read the previous discussion and it seems to me there were = two > > common arguments against: > > * Just design better APIs > > * Named parameters would be better > > > > Nobody has been able to crack named parameters (and it doesn't seem = likely > > anytime soon), and as we've seen from the JSON example above it's = not > > always as simple as having better APIs, so I wanted to see whether = people > > would be willing to support the *default* keyword for optional = parameters > > now. > > > > Thanks, > > Craig >=20 >=20 >=20 --Apple-Mail=_DC9D0944-97B1-43A1-A1F5-11E24A1309F7--