Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105125 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 62073 invoked from network); 7 Apr 2019 02:02:04 -0000 Received: from unknown (HELO mail-ot1-f41.google.com) (209.85.210.41) by pb1.pair.com with SMTP; 7 Apr 2019 02:02:04 -0000 Received: by mail-ot1-f41.google.com with SMTP id u15so8790851otq.10 for ; Sat, 06 Apr 2019 15:58:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Gt3y9vLugbajaN/hTLG7Ral3lA/sB3SnxpwiAlM4wUs=; b=cjfmHtH0PNdh4gF/fPgpkb79kmMM8oqo/od2VIfwK6kkCZm/XwG8HZvhiSwShdEZEz d3yMe1IWEpEqCKZD/Y5MUHmTol0Tp+oybORm+M2doqGg4AJbd9d9hM7HX3ePLG1dEP7K NIyER7TeHaSpuYsmMDS1UCIBWz8Cf93F53qTiG4iXxUcPiY7S0pmq7xzOh4/NLG0+qda gH3o9Hqr7xPNaLIGb3Lqxd83Jkc/j8MYnMLDsWBoMMYkjze+QzmteX6CWbFEs9rIVYZp pQdFPvEbSHmlDKdDh5wbSot3cOVKvF8Yz9lgf/LbH6Xh40hPi+fYyGIP9YdrOJQTR6fI BinA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Gt3y9vLugbajaN/hTLG7Ral3lA/sB3SnxpwiAlM4wUs=; b=g0thQdfBqUsYwOwI1+svBfVbJwZtS3URSaSiF/juxSrqkBnIV440KxEoIpUEjqppZk FKxBff21YuKNUyYxYo+zmK7ErYvr52nZYSy9nUOlwjjzFrtZuMIzkSmsFZMWKzzRHD4E KvzilLmwWhSgEPFXUSFzu8l/t1TM58JYouGZPDvqmxVryJFS9bVSaL7QocGm0ZzX70PY UbL9MyvmC3p8HB1VeM6319to5ZqllqlxZq1SB2syebwBNWfYBD6CwM81IiGZM8UKuxd1 9EPJu+GwoYDwYzFkjjFPVu/Ytf1asH+6+0BEOav/mV6zPvqz9PLYTosK3crlwkE0N/bk j20Q== X-Gm-Message-State: APjAAAWUgK6hIelsUAM+mskQZ93aMWvYAgpX1gHLfwieS++DYjN+o74M dzMxFvZF1mEdt7Xd0OhjsMw37IKGkbFiR+QqFgc= X-Google-Smtp-Source: APXvYqxYR4MeqOqkHHAIXr89tiLBdSlxOT816/dA6+gqC+LrAQKbflc7WjSzYkj5jdWetjE76KJOfB+pYip0zjNUsJA= X-Received: by 2002:a9d:7455:: with SMTP id p21mr13664712otk.180.1554591498940; Sat, 06 Apr 2019 15:58:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 6 Apr 2019 23:58:06 +0100 Message-ID: To: Morgan Breden Cc: Craig Duncan , Internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Parameter skipping From: robehickman@gmail.com (Robert Hickman) Why not just wrap the function in another function? On Sat, 6 Apr 2019 at 23:46, Morgan Breden wrote: > > The problem I see with this approach is that a keyword for skipping > parameters > would really just be a stopgap solution until something like Named > Parameters > can be added. > > Is it really appropriate to add a feature that only serves a temporary > purpose? > > On Sat, Apr 6, 2019 at 5:15 PM Craig Duncan wrote: > > > 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 > >