Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77866 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3175 invoked from network); 10 Oct 2014 23:24:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Oct 2014 23:24:36 -0000 Authentication-Results: pb1.pair.com header.from=leight@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=leight@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.52 as permitted sender) X-PHP-List-Original-Sender: leight@gmail.com X-Host-Fingerprint: 74.125.82.52 mail-wg0-f52.google.com Received: from [74.125.82.52] ([74.125.82.52:46907] helo=mail-wg0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9C/05-06615-2BA68345 for ; Fri, 10 Oct 2014 19:24:35 -0400 Received: by mail-wg0-f52.google.com with SMTP id a1so4960528wgh.11 for ; Fri, 10 Oct 2014 16:24:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=RaicQdGnVaBam9qJLCVgnW0IiBSXufYTbZHZvWsbpSM=; b=BA+oyZJPxOq1cM8aZdR+Rf/Q15OOzUkdwBNbJVk6y47PPiGVuW6XFoWaIaBiLaVllk 6Jh/7hlNN8zJCs4KTCyez0j9sbjiAiVN6GH9mM25evvbW+HEbO2yl6ai0khwp4C7s4jH SFlYiaohTsxdSrZUHI7ypq4a6i5BZ8N6pk0M9eqD6ohrjnx+ljN0XPLBJv3nBmmDYku5 kmq9j/Is4NcdXQ5IJGhG0dSA8LTy1FXhmigHqXj/nixvqTK9JM23Tj4ppgPPgo7ON6RA ZQFwCMpTEiHW1essOUGIGifCr8nEdopMMqcIH/QyyRTBP8b2ua0BxwkV6Syq04wCTiks QirQ== MIME-Version: 1.0 X-Received: by 10.194.179.200 with SMTP id di8mr7537751wjc.62.1412983472365; Fri, 10 Oct 2014 16:24:32 -0700 (PDT) Received: by 10.217.55.195 with HTTP; Fri, 10 Oct 2014 16:24:32 -0700 (PDT) In-Reply-To: References: Date: Sat, 11 Oct 2014 00:24:32 +0100 Message-ID: To: Marco Pivetta Cc: PHP Internals List Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Deprecation of func_get_args(), call_user_func_array() and related API From: leight@gmail.com (Leigh) On 10 October 2014 21:27, Marco Pivetta wrote: > Hello folks, > > While rambling with some code today, I realized that `call_user_func` > behaves strangely, appearing and disappearing from stack traces depending > on versions of PHP. For an example, compare > http://3v4l.org/fGpIk#vphp7@20140901, http://3v4l.org/fGpIk#v530 and > http://3v4l.org/fGpIk#vhhvm-301. > Ok. Knee jerk reaction is +1 for consistency, we should decide on what is the expected and accepted behaviour and make sure tests are written so that we don't deviate from that. > Therefore, here comes my idea of simply getting rid of `call_user_func`, > `call_user_func_array`, `func_get_args`, `func_num_args` and `func_get_arg`. > > My plan for it would be to add a deprecation (notice? not sure about that) > in PHP 5.7, and a complete removal of those methods in PHP 7.0. > I understand your impulse, but I agree with others, these are far too widely used to be deprecated like this > BC compatibility is easily achieved as variadics ( > https://wiki.php.net/rfc/variadics) allow for writing cleaner and less > complex versions: > True. So can we make these functions behave as if variadics were used without removing them? Something akin to making these functions language constructs?