Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34228 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49934 invoked by uid 1010); 23 Dec 2007 02:24:29 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 49919 invoked from network); 23 Dec 2007 02:24:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Dec 2007 02:24:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=troelskn@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=troelskn@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.198.191 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: troelskn@gmail.com X-Host-Fingerprint: 209.85.198.191 rv-out-0910.google.com Received: from [209.85.198.191] ([209.85.198.191:50327] helo=rv-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A8/92-30911-8D6CD674 for ; Sat, 22 Dec 2007 21:24:29 -0500 Received: by rv-out-0910.google.com with SMTP id k15so761161rvb.23 for ; Sat, 22 Dec 2007 18:24:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=2DbA47QDt8MGymP4wgrxwWb0SnEzViazRKWpx+Zft6Q=; b=hifEMdXvgS26KFM2wTZTSGlp8Z/NVPMkEzUJcGy/M7Y2+niJVFJ/6aD0J3UFFof6J4ZlYECdc2GCH82kFun9mdgai4Ds6iQMQzUpY3CT1SKrl0hwfuPQ1pxUmO/VK21+duAUMGXVxfTEgT4k5SHkAxM0cHOd3IOj2xAP2qA7hu4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ct3vvbQrGhZ1RuwWhmSQM/GYy33j+QGoEPMrtetPC3jbdZILKE+q7iMMNHV/imJ7BW1K0NxcZCVPwzgRVnJ11F1MDAKfr3uO8z/FmLBzFwHbOSmRAsffZWtbH7w8G9elIvsPZj1djnWXma8X1c4iqlGIlDih5FiiMXu8CdX6naQ= Received: by 10.141.99.4 with SMTP id b4mr1185653rvm.275.1198376662431; Sat, 22 Dec 2007 18:24:22 -0800 (PST) Received: by 10.141.50.16 with HTTP; Sat, 22 Dec 2007 18:24:22 -0800 (PST) Message-ID: <98b8086f0712221824n320ce3btca61b2d3328c4477@mail.gmail.com> Date: Sun, 23 Dec 2007 03:24:22 +0100 To: internals@lists.php.net In-Reply-To: <476DB8AD.3060608@gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <98b8086f0712150818n40056cedyf0aae7a5a08a27b7@mail.gmail.com> <476582E6.7020808@zend.com> <200712172130.08216.larry@garfieldtech.com> <4FADC266-873E-4FD2-BEC8-28EA9D833297@procata.com> <476D2854.5070803@gmx.net> <503D0384-1014-4CD1-BCAC-8F0950D5FC68@bitxtender.com> <476DB8AD.3060608@gmx.net> Subject: Re: [PHP-DEV] PATCH: Implementing closures in PHP From: troelskn@gmail.com ("troels knak-nielsen") On Dec 23, 2007 2:23 AM, Christian Seiler wrote: > First of all: I don't quite understand what you mean when you want to > serialize a function (closure or not)? The opcodes? Ok, sure, with the > current PHP implementation you can serialize the variable used to CALL > the function (e.g. with $func = 'str_replace'; $func is only a string Admittedly, I got the idea, in relation to Wez' patch. There, it would be trivial to serialize/unserialize the function pointer. I suppose that isn't immediately possible, if the closure is a resource type. > and can be serialized). But where would you need that? (Ok, for normal > functions that are named this could actually be useful, but for > anonymous functions?) If a closure could be serialized, it would allow for continuation style applications. I'm not sure, how good idea this is in web applications anyway, so just ignore that. Just a minor note; The semi-colon after the closing brace, seems superfluous. Is there any reason for it? Otherwise excellent work there. -- troels