Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63170 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8229 invoked from network); 19 Sep 2012 18:23:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Sep 2012 18:23:55 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 64.22.89.133 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 64.22.89.133 oxmail.registrar-servers.com Received: from [64.22.89.133] ([64.22.89.133:39956] helo=oxmail.registrar-servers.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 68/42-15057-9BD0A505 for ; Wed, 19 Sep 2012 14:23:53 -0400 Received: from [192.168.0.200] (5ad4bfa1.bb.sky.com [90.212.191.161]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by oxmail.registrar-servers.com (Postfix) with ESMTPSA id D2FD87580D1; Wed, 19 Sep 2012 14:23:49 -0400 (EDT) Message-ID: <505A0D85.2090200@ajf.me> Date: Wed, 19 Sep 2012 19:23:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 To: Steve Clay CC: PHP Internals References: <50593266.5010802@mrclay.org> <5059FE96.7080406@ajf.me> <505A074C.70501@mrclay.org> <505A085E.1050808@ajf.me> <505A0D3F.3040604@mrclay.org> In-Reply-To: <505A0D3F.3040604@mrclay.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] RFC: alternative callback syntax From: ajf@ajf.me (Andrew Faulds) On 19/09/12 19:21, Steve Clay wrote: > On 9/19/12 2:01 PM, Andrew Faulds wrote: >>> Some other ideas: >>> >>> $cb = (callable) $obj->bar; >> Ah, but (callable) that won't work for global functions, since >> (callable) is a cast, and > > (callable) is not usable as a cast (at least in 5.4.7): > > $a = (callable)'str'; // Parse error: syntax error, unexpected > 'callable' (T_CALLABLE) > > This could work, and it makes sense to me at least. Yes, the problem is that it would add a special syntax case, where (cast)identifier, in this case, uses a function name, not an expression. This is bad. -- Andrew Faulds http://ajf.me/