Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85218 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93147 invoked from network); 19 Mar 2015 16:25:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Mar 2015 16:25:53 -0000 Authentication-Results: pb1.pair.com header.from=php@bof.de; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=php@bof.de; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain bof.de designates 80.242.145.70 as permitted sender) X-PHP-List-Original-Sender: php@bof.de X-Host-Fingerprint: 80.242.145.70 mars.intermailgate.com Received: from [80.242.145.70] ([80.242.145.70:55262] helo=mars.intermailgate.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C0/70-25408-098FA055 for ; Thu, 19 Mar 2015 11:25:53 -0500 Received: (qmail 23813 invoked by uid 1009); 19 Mar 2015 17:25:50 +0100 Received: from 192.109.53.146 by mars (envelope-from , uid 89) with qmail-scanner-1.25-st-qms (clamdscan: 0.96.2/20206. spamassassin: 3.3.1. perlscan: 1.25-st-qms. Clear:RC:0(192.109.53.146):SA:0(1.3/8.0):. Processed in 0.230109 secs); 19 Mar 2015 16:25:50 -0000 X-Spam-Status: No, hits=1.3 required=8.0 X-Spam-Level: + X-Antivirus-MYDOMAIN-Mail-From: php@bof.de via mars X-Antivirus-MYDOMAIN: 1.25-st-qms (Clear:RC:0(192.109.53.146):SA:0(1.3/8.0):. Processed in 0.230109 secs Process 23796) Received: from unknown (HELO rofl.localnet) (gmail@bof.de@192.109.53.146) by mars.intermailgate.com with AES256-SHA encrypted SMTP; 19 Mar 2015 17:25:49 +0100 To: internals@lists.php.net Cc: "S.A.N" Date: Thu, 19 Mar 2015 17:25:48 +0100 Message-ID: <1465198.mSjKnCggUz@rofl> User-Agent: KMail/4.14.4 (Linux/3.19.1-2.gc0946e9-desktop; KDE/4.14.4; x86_64; ; ) In-Reply-To: References: <54BEC072.5000507@mabe.berlin> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [PHP-DEV] Inconsistencies in callable, call_user_func and direct variable calls From: php@bof.de (Patrick Schaaf) On Thursday 19 March 2015 18:17:50 S.A.N wrote: > > Then how would you write an callback containing an already constructed > > object? $a = [$object, 'method']; > > > > The alternative is unnecessarily cumbersome: > > $a = function($methodArg1, $methodArg2) use($object) { return > > $object->method($methodArg1, $methodArg2); }; > > $object->$methodName(...$args); That's a call. Requested was an assignment. You cannot assign that and pass it around for later calling. You cannot pass that as a callable parameter. Patrick