Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85247 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74942 invoked from network); 19 Mar 2015 22:57:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Mar 2015 22:57:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=dennis@birkholz.biz; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=dennis@birkholz.biz; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain birkholz.biz does not designate 144.76.185.252 as permitted sender) X-PHP-List-Original-Sender: dennis@birkholz.biz X-Host-Fingerprint: 144.76.185.252 mx01.nexxes.net Received: from [144.76.185.252] ([144.76.185.252:56355] helo=mx01.nexxes.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 74/00-25408-7645B055 for ; Thu, 19 Mar 2015 17:57:45 -0500 Received: from [137.226.183.192] (ip3192.saw.rwth-aachen.de [137.226.183.192]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: db220660-p0g-1@packages.nexxes.net) by mx01.nexxes.net (Postfix) with ESMTPSA id B7E88482455 for ; Thu, 19 Mar 2015 23:57:40 +0100 (CET) Message-ID: <550B5464.6090504@birkholz.biz> Date: Thu, 19 Mar 2015 23:57:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: internals@lists.php.net References: <54BEC072.5000507@mabe.berlin> <54C28B63.1040506@gmail.com> <54C2E405.4090204@gmail.com> <550B1DFC.9060704@birkholz.biz> <550B2704.7010502@birkholz.biz> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Inconsistencies in callable, call_user_func and direct variable calls From: dennis@birkholz.biz (Dennis Birkholz) Am 19.03.2015 um 22:11 schrieb Levi Morrison: > On Thu, Mar 19, 2015 at 1:44 PM, Dennis Birkholz wrote: >> Hi, >> >> Am 19.03.2015 um 20:26 schrieb Levi Morrison: >>> On Thu, Mar 19, 2015 at 1:05 PM, Dennis Birkholz wrote: >>>> Hi, >>>> >>>> Am 19.03.2015 um 17:27 schrieb Sebastian B.-Hagensen: >>>>> Another way to unify array and string callback may be to use the >>>>> callable syntax and have it return a closure: >>>>> callable('strlen'); >>>>> callable($object, $methodName); >>>>> callable('class', 'staticMethod') >>>> >>>> but before that happens, we should make closures serializable. >>> What does closures being serializable have to do with this feature? >> >> If you replace the array($object, 'method') syntax by callable($object, >> 'method') which returns a closure, you can not serialize callables any >> more which is currently possible. Before we replace working language >> features by closures we should update closures to be usable in all >> required situations. > > Many callable are inherently not serializable. This is not solvable in > the general case. > > Why are you serializing array($object, "method") callable currently? > (As in, what is the use case?) passing callbacks to a worker process, storing an object structure with a their of event handlers, etc.