Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77932 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39914 invoked from network); 13 Oct 2014 18:21:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Oct 2014 18:21:02 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@mabe.berlin; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php@mabe.berlin; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mabe.berlin from 80.237.132.167 cause and error) X-PHP-List-Original-Sender: php@mabe.berlin X-Host-Fingerprint: 80.237.132.167 wp160.webpack.hosteurope.de Received: from [80.237.132.167] ([80.237.132.167:55963] helo=wp160.webpack.hosteurope.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F5/F0-32407-A081C345 for ; Mon, 13 Oct 2014 14:20:59 -0400 Received: from dslb-178-012-036-206.178.012.pools.vodafone-ip.de ([178.12.36.206] helo=[192.168.178.30]); authenticated by wp160.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) id 1XdkEp-0000F2-HH; Mon, 13 Oct 2014 20:20:55 +0200 Message-ID: <543C1805.9000700@mabe.berlin> Date: Mon, 13 Oct 2014 20:20:53 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: internals@lists.php.net References: <5439B266.8070300@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-bounce-key: webpack.hosteurope.de;php@mabe.berlin;1413224459;21c0bb9b; Subject: Re: [PHP-DEV] Deprecation of func_get_args(), call_user_func_array() and related API From: php@mabe.berlin (Marc Bennewitz) On 13.10.2014 02:45, Marco Pivetta wrote: > On 12 October 2014 00:47, Andrea Faulds wrote: > >> On 11 Oct 2014, at 23:42, Rowan Collins wrote: >> >>> func_get_args() and func_num_args(), OTOH, existed solely to support >> variadics, and anything taking advantage of them being functions rather >> than a language structure would have to be quite exotic and arcane, so in >> principle they could, eventually, be removed, but I agree with others that >> it's far too soon to remove a feature which has been around since 4.0 just >> becuase 5.6 includes a better alternative. >> >> They have some (admittedly limited) use beyond variadics. If you make a >> function and later make it redirect to another, you can preserve your >> typehints by using func_get_args() rather than using the … syntax. > Can anyone come up with those use-cases? If there is something that > `func_get_args()` can do and that can't be done with the code examples that > I've pasted before, then I'm missing some bits of information that may make > the entire proposal moot. Your implementation of "userland_call_user_func" doesn't have the same visibility as "call_user_func[_array]": http://3v4l.org/lNgub >>> If they're included in the core distribution, then why make them >> optional at all? If it's just a question of how the functions behave, then >> surely an included (and C-level) implementation should be sought which has >> the better behaviour? >> >> This matches my own thoughts. There is nothing wrong with these functions. >> There are just some issues with their implementation. We do not need to get >> rid of the functions, that would be an absurd overreaction. We should just >> fix the implementations. > > The point is removing more API from core and moving it to userland. > API implemented in core needs to be maintained by core devs, and is > non-transparent to consumers (reflection/debugging/etc). > In general, I've always been against any non-language feature that isn't > implemented with the language itself, but it's my point of view: as a > simple rule of thumb (my rule, many would just say I'm crazy), if it can be > implemented in PHP, then don't add it to core or extensions. > I would suggest the same deprecation approach for many `array_*` functions, > but I assume that I'd only start a giant shitstorm (pardon the wording, but > that's the most precise term for that) about performance. > > Anyway, it's clear that this proposal has short legs, and won't get > anywhere in a vote. > > Greets, > > Marco Pivetta > > http://twitter.com/Ocramius > > http://ocramius.github.com/ >