Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85245 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69888 invoked from network); 19 Mar 2015 22:12:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Mar 2015 22:12:52 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.175 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.175 mail-wi0-f175.google.com Received: from [209.85.212.175] ([209.85.212.175:36101] helo=mail-wi0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 71/4F-25408-3E94B055 for ; Thu, 19 Mar 2015 17:12:52 -0500 Received: by wibg7 with SMTP id g7so129999658wib.1 for ; Thu, 19 Mar 2015 15:12:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=whDZPMRHxWucIeBueGNGQKVxw0jJW+dyT4rZBoPGwFM=; b=NrR7lDDukkQBYV6ZQ4IaoTn8GRJZIOXhqha5QLz8nEzKfSxbLJ3fp776K60l5HHSzp GgvMdAYpEFnE7I/pXPDtuDl2dr35fHagHhqLziEebIS++Ue4diKY0hjl7BPbMxgCm1cd lRH1tlQV97ZcOe3K8XRJCBSxHz9uiZeyQ8IvQTLQkkQFZLbJwSKHU4/8RNA8yxF5/4Ys BNy3Gv/0APOU4yX6urYRUOi42lBS+p0dlV64pgToyLTympQdCT6PN76NOAQU84L1TEXR QNtyymMkjDad14khv3QhrmBxUZhbLfXPkN/cAgNUYDTT8s7cgArCBSeoK1GKxiQxxydI LTPA== X-Received: by 10.180.20.233 with SMTP id q9mr19691415wie.75.1426803169009; Thu, 19 Mar 2015 15:12:49 -0700 (PDT) Received: from [192.168.0.5] (cpc68956-brig15-2-0-cust215.3-3.cable.virginm.net. [82.6.24.216]) by mx.google.com with ESMTPSA id ax10sm3712260wjc.26.2015.03.19.15.12.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Mar 2015 15:12:48 -0700 (PDT) Message-ID: <550B49D8.4080608@gmail.com> Date: Thu, 19 Mar 2015 22:12:40 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: "internals@lists.php.net" References: <54BEC072.5000507@mabe.berlin> <54C28B63.1040506@gmail.com> <54C2E405.4090204@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Inconsistencies in callable, call_user_func and direct variable calls From: rowan.collins@gmail.com (Rowan Collins) On 19/03/2015 20:50, Yasuo Ohgaki wrote: > Hi Sebastian, > > On Thu, Mar 19, 2015 at 9:48 PM, Sebastian B.-Hagensen > > wrote: > > 2015-03-19 12:51 GMT+01:00 Yasuo Ohgaki >: > > Distinguishing array and callable is problematic. > > Array callable is better to be deprecated in the long run. IMHO. > > 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); }; > > > I'm not proposing deprecate it soon, but in the long run. > It will need a decade to deprecate it. It is not time that is needed, but an alternative way of expressing "use this instance method as a callback", such as those discussed elsewhere in the thread. Regards, -- Rowan Collins [IMSoP]