Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:8250 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4223 invoked by uid 1010); 28 Feb 2004 16:09:17 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 4198 invoked from network); 28 Feb 2004 16:09:17 -0000 Received: from unknown (HELO moutng.kundenserver.de) (212.227.126.183) by pb1.pair.com with SMTP; 28 Feb 2004 16:09:17 -0000 Received: from [212.227.126.205] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1Ax71g-0007iB-00; Sat, 28 Feb 2004 17:09:16 +0100 Received: from [80.139.3.226] (helo=[80.139.3.226]) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1Ax71f-0006xW-00; Sat, 28 Feb 2004 17:09:16 +0100 To: Marcus Boerger Cc: internals@lists.php.net In-Reply-To: <1281326011265.20040226085752@marcus-boerger.de> References: <5.1.0.14.2.20040225164026.02c28540@127.0.0.1> <1077755589.685.74.camel@localhost> <1077771016.685.174.camel@localhost> <1077773231.685.177.camel@localhost> <1281326011265.20040226085752@marcus-boerger.de> Content-Type: multipart/mixed; boundary="=-KA35rvgLLk8Ejql6D3eJ" Message-ID: <1077984284.314.5.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Sat, 28 Feb 2004 17:04:44 +0100 X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:e958292ea7b1c44e51b2b9ca0a9da460 Subject: Re: Fwd: [PHP-DEV] RC1 From: thekid@thekid.de (Timm Friebe) --=-KA35rvgLLk8Ejql6D3eJ Content-Type: text/plain Content-Transfer-Encoding: 7bit On Thu, 2004-02-26 at 08:57, Marcus Boerger wrote: > Hello Timm, > > i think this is not completley correct. When reflection is used from a > static member of the class itself it should still work. Correct: class Foo { protected function __construct() { } public static function create() { $r= new Reflection_Class('Foo'); return $r->newInstance(); } } should work as newInstance() is called within the context "Foo". > We have functions which enable such checks. I've tried to find out which context I am in. Alas, EG(scope)->name contains "reflection_class" at the moment I'm trying to check it. Something like EG(prev_execute_data) might help, but I'm not sure I should be using it:) > Could you have a try with those? Also i have > already incorporated the other patch so you need to update the engine > sources. I saw that, but you missed this one (fixes the following segfault: $ cat reflection_segfault.php $ php-dev reflection_segfault.php Segmentation fault (core dumped) Attached is a one-line patch that fixes it. - Timm --=-KA35rvgLLk8Ejql6D3eJ Content-Disposition: attachment; filename=zend_reflection_api.diff Content-Type: text/x-patch; name=zend_reflection_api.diff; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Index: zend_reflection_api.c =================================================================== RCS file: /repository/ZendEngine2/zend_reflection_api.c,v retrieving revision 1.89 diff -u -r1.89 zend_reflection_api.c --- zend_reflection_api.c 26 Feb 2004 01:06:18 -0000 1.89 +++ zend_reflection_api.c 26 Feb 2004 07:24:07 -0000 @@ -1800,6 +1800,7 @@ zval_add_ref(&argument); } } else { + convert_to_string_ex(&argument); if (zend_lookup_class(Z_STRVAL_P(argument), Z_STRLEN_P(argument), &ce TSRMLS_CC) == FAILURE) { zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Class %s does not exist", Z_STRVAL_P(argument)); --=-KA35rvgLLk8Ejql6D3eJ--