Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38562 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50431 invoked from network); 24 Jun 2008 07:19:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jun 2008 07:19:36 -0000 Authentication-Results: pb1.pair.com header.from=kalle@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=kalle@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 67.19.4.138 as permitted sender) X-PHP-List-Original-Sender: kalle@php.net X-Host-Fingerprint: 67.19.4.138 8a.4.1343.static.theplanet.com Received: from [67.19.4.138] ([67.19.4.138:35493] helo=web.clantemplates.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 29/78-32235-700A0684 for ; Tue, 24 Jun 2008 03:19:36 -0400 Received: from [127.0.0.1] (helo=localhost) by web.clantemplates.com with esmtpa (Exim 4.63) (envelope-from ) id 1KB2oJ-0006gT-JX; Tue, 24 Jun 2008 00:19:04 -0700 Received: from 195.137.194.64 ([195.137.194.64]) by zesix.com (Horde MIME library) with HTTP; Tue, 24 Jun 2008 00:19:27 -0700 Message-ID: <20080624001927.68jooftqlckgkos8@zesix.com> Date: Tue, 24 Jun 2008 00:19:27 -0700 To: internals@lists.php.net References: <4856A547.3080801@gmx.net> <698DE66518E7CA45812BD18E807866CE01B11811@us-ex1.zend.net> <4858FCC7.5030305@gmx.net> <698DE66518E7CA45812BD18E807866CE01B70D73@us-ex1.zend.net> <48596C9E.2080605@gmx.net> <485FE3C1.4010303@zend.com> In-Reply-To: <485FE3C1.4010303@zend.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.1.6) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - web.clantemplates.com X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - php.net Subject: Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP From: kalle@php.net (Kalle Sommer Nielsen) Hey How are we going to deal with Closures in class properties, like: class PHP { public $closure; public function __construct($callback) { $this->closure = $callback; } public function closure() { echo 'PHP::closure'; } } $closure = function() { echo 'PHP::$closure'; }; $test = new PHP; Now calling $closure->closure(); whats going to happen? I would assume it executes the method first if and if there aren't a method with the name it will execute the $closure property? Another subject I would like to see now the closures has been brought up again is, how about adding type hinting in method/function prototypes: function call(function $callback) { $callback(); } call(function(){ echo 'Hello'; }); We could make reuse of the function keyword in the prototypes which saves us from adding another keyword to the language. Cheers, Kalle