Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66736 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89889 invoked from network); 21 Mar 2013 13:16:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Mar 2013 13:16:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=steve@mrclay.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=steve@mrclay.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mrclay.org from 50.22.11.19 cause and error) X-PHP-List-Original-Sender: steve@mrclay.org X-Host-Fingerprint: 50.22.11.19 bedford.accountservergroup.com Received: from [50.22.11.19] ([50.22.11.19:58129] helo=bedford.accountservergroup.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5E/02-07112-3280B415 for ; Thu, 21 Mar 2013 08:16:20 -0500 Received: from n128-227-134-116.xlate.ufl.edu ([128.227.134.116]:58230 helo=Distance-Ed-Sclay.local) by bedford.accountservergroup.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.80) (envelope-from ) id 1UIfLs-0009ix-RX; Thu, 21 Mar 2013 08:16:16 -0500 Message-ID: <514B0820.2080404@mrclay.org> Date: Thu, 21 Mar 2013 09:16:16 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 MIME-Version: 1.0 To: Derick Rethans CC: PHP Internals References: <51432E01.7090502@mrclay.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bedford.accountservergroup.com X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mrclay.org Subject: Re: [PHP-DEV] Could we kill call_user_func? From: steve@mrclay.org (Steve Clay) On 3/21/13 7:37 AM, Derick Rethans wrote: > On Fri, 15 Mar 2013, Steve Clay wrote: > >> call_user_func() just seems so ugly now that we have nicer syntax in >> so many other areas. > > That doesn't mean we should just be ripping out functionality that works > perfectly fine. I was not clear in my initial post. I don't want call_user_func removed, just made unnecessary. To reiterate why: 1. call_user_func fails reference args. (It's not a full substitute for a direct call) 2. Most callable values are already directly callable: ✓ func as string ✓ dynamic method as array ✓ static method as array static method as string ✓ Closure ✓ object with __invoke Closure in object property (I understand why this is off the table) expression containing Closure in object property If always store the callable in a var, the situation is much better: ✓ func as string ✓ dynamic method as array ✓ static method as array static method as string ✓ Closure ✓ object with __invoke ✓ Closure in object property How difficult would it be to support making this work? $c = "Foo::bar"; $c(); Steve Clay -- http://www.mrclay.org/