Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39834 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67315 invoked from network); 11 Aug 2008 18:45:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Aug 2008 18:45:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=chris_se@gmx.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=chris_se@gmx.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.net designates 213.165.64.20 as permitted sender) X-PHP-List-Original-Sender: chris_se@gmx.net X-Host-Fingerprint: 213.165.64.20 mail.gmx.net Linux 2.5 (sometimes 2.4) (4) Received: from [213.165.64.20] ([213.165.64.20:58076] helo=mail.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 27/29-30561-9B880A84 for ; Mon, 11 Aug 2008 14:45:14 -0400 Received: (qmail invoked by alias); 11 Aug 2008 18:45:10 -0000 Received: from p54A15B4E.dip.t-dialin.net (EHLO chris-se.dyndns.org) [84.161.91.78] by mail.gmx.net (mp027) with SMTP; 11 Aug 2008 20:45:10 +0200 X-Authenticated: #186999 X-Provags-ID: V01U2FsdGVkX1/IdVwMjXjIpS6DYjlY/k4PXHEs6hTEF48AxlTcPC oVsIhKvjA8UmRW Received: from [192.168.100.13] (cobalt.seiler.lan [192.168.100.13]) by chris-se.dyndns.org (Postfix) with ESMTP id 05E511B138; Mon, 11 Aug 2008 20:03:49 +0200 (CEST) Message-ID: <48A08853.6020403@gmx.net> Date: Mon, 11 Aug 2008 20:43:31 +0200 User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Marcus Boerger CC: Dmitry Stogov , =?UTF-8?B?Sm9oYW5uZXMgU2NobMO8dGVy?= , Felipe Pena , php-dev List 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> In-Reply-To: <302695240.20080811144502@marcus-boerger.de> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.55 Subject: Re: [PHP-DEV] [PATCH] Closures and reflection improvements From: chris_se@gmx.net (Christian Seiler) 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? Regards, Christian