Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39837 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99567 invoked from network); 11 Aug 2008 19:40:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Aug 2008 19:40:28 -0000 Authentication-Results: pb1.pair.com smtp.mail=helly@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=helly@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 85.214.94.56 as permitted sender) X-PHP-List-Original-Sender: helly@php.net X-Host-Fingerprint: 85.214.94.56 aixcept.net Linux 2.6 Received: from [85.214.94.56] ([85.214.94.56:39114] helo=h1149922.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B7/20-30561-BA590A84 for ; Mon, 11 Aug 2008 15:40:28 -0400 Received: from MBOERGER-ZRH (unknown [193.142.125.1]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by h1149922.serverkompetenz.net (Postfix) with ESMTP id 3B32D11F2BE; Mon, 11 Aug 2008 21:40:25 +0200 (CEST) Date: Mon, 11 Aug 2008 21:40:21 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <1714419722.20080811214021@marcus-boerger.de> To: Christian Seiler CC: php-dev List In-Reply-To: <48A08853.6020403@gmx.net> References: <48886651.80407@gmx.net> <4889F43D.8030609@gmx.net> <4896B0B4.2090801@zend.com> <1217847553.4175.23.camel@goldfinger.johannes.nop> <875726149.20080808234837@marcus-boerger.de> <803831941.20080809003459@marcus-boerger.de> <1199358810.20080811005138@marcus-boerger.de> <489FFDA0.4080206@zend.com> <1446091491.20080811122357@marcus-boerger.de> <302695240.20080811144502@marcus-boerger.de> <48A08853.6020403@gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [PATCH] Closures and reflection improvements From: helly@php.net (Marcus Boerger) Hello Christian, Monday, August 11, 2008, 8:43:31 PM, you wrote: > Hi, >> all submitted now. Thanks everyone for their help and especially >> Christian for getting this started. > Thanks for making my patch work after the modifications in > zend_closures.c. I'm sorry I couldn't do it myself but I was kind of > busy the last few days and the "simple fix" created memory leaks and I > didn't want to post a knowingly broken patch. > Anyway, there are still segfaults in the current version: > $foo = function ($a) {}; > $o = new ReflectionMethod ($foo); > $p = $o->getParameters (); > unset ($o); > $m = $p[0]->getDeclaringFunction (); > Reflection::export ($m); > $foo = function ($a) {}; > $p = new ReflectionParameter ($foo, 'a'); > $m = $p->getDeclaringFunction (); > unset ($p); > Reflection::export ($m); > This is due to the fact that getParameters() / getDeclaringFunction() > don't copy the fptr and fptr->common.function_name pointers if it's a > closure. Here are patches for PHP 5.3 and HEAD that fix the problem: > http://www.christian-seiler.de/temp/php/2008-08-11-reflection/segfaults-5.3.patch > http://www.christian-seiler.de/temp/php/2008-08-11-reflection/segfaults-6.patch > Also, the following test that I already posted should be added to > PHP_5_2, PHP_5_3 and HEAD: > http://www.christian-seiler.de/temp/php/2008-07-24-reflection/reflectionParameter_invalidMethodInConstructor.phpt > The test already works for PHP_5_3 (since the fix for that was included > in my original patch) but a segfault still occurs in PHP_5_2 and HEAD, > my patch that I already posted fixes that problem for 5.2: > http://www.christian-seiler.de/temp/php/2008-07-24-reflection/reflection-segfault-fix-5.2.patch > My original patch also fixed the problem for HEAD, I readded that part > to the above segfault patch for HEAD. >> Also, it appears you do not have a cvs account, or did I overlook >> something? > No, I don't. Dmitry also mentioned that - should I request one? Account approved and access granted. Please provide the function copying in a function next to _free_function() and care for parameter info as well (yeah sorry for the additional work). And then, happy submitting. Also for your next patches (cvs di -N) allows to ship the new files in the patch and (cvs di -Np) shows the context, which makes reading the patches easier. Best regards, Marcus