Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85242 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59278 invoked from network); 19 Mar 2015 21:11:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Mar 2015 21:11:48 -0000 Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.44 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.218.44 mail-oi0-f44.google.com Received: from [209.85.218.44] ([209.85.218.44:33210] helo=mail-oi0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 20/6D-25408-39B3B055 for ; Thu, 19 Mar 2015 16:11:48 -0500 Received: by oifl3 with SMTP id l3so45917135oif.0 for ; Thu, 19 Mar 2015 14:11:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=z4XoDAQ12qg8/kDbHvyJYjlQd0R3ACDjbJiJuqgixF8=; b=r961Sh4XsVdrqzBv7yRrM+ox20NiW5af0v6uiBZHtHDS8sol/yxbMffiu1QIvyiuaP eVxtU4fpyKFkXrwdyZ2Jb2nbrEFwAacbjPp+DMCQ1ZJqN8n7nO+mmYusxjdLA8ZKWbBL /mgdpEv4SAMSGGRJ9NrozuXD82Ba80hISld1+qV1fY32ePdn6/7x8aSUWKsAG8PUUGyD vDDVBKcBDNilUupGTXImlxCRHG+C6VgPD7/oSWdzYup7op+7nY4kWx5nR6jJrjnJwc+u D9sFUHuFrX1pQje1ggcRN/TEp5MSeWnyxhbK0JINu4AuDtIgYLlHkh9sTZR84pzTw0wQ ZPwA== MIME-Version: 1.0 X-Received: by 10.202.178.131 with SMTP id b125mr59694338oif.80.1426799505081; Thu, 19 Mar 2015 14:11:45 -0700 (PDT) Sender: morrison.levi@gmail.com Received: by 10.76.93.143 with HTTP; Thu, 19 Mar 2015 14:11:44 -0700 (PDT) In-Reply-To: <550B2704.7010502@birkholz.biz> References: <54BEC072.5000507@mabe.berlin> <54C28B63.1040506@gmail.com> <54C2E405.4090204@gmail.com> <550B1DFC.9060704@birkholz.biz> <550B2704.7010502@birkholz.biz> Date: Thu, 19 Mar 2015 15:11:44 -0600 X-Google-Sender-Auth: GgkWh47ut5bJew8Mb6044QF7Vu8 Message-ID: To: Dennis Birkholz Cc: internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Inconsistencies in callable, call_user_func and direct variable calls From: levim@php.net (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?)