Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40933 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8287 invoked from network); 10 Oct 2008 20:58:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Oct 2008 20:58:06 -0000 Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.163 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.163 il-gw1.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.163] ([212.25.124.163:46601] helo=il-gw1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6B/22-38373-CD1CFE84 for ; Fri, 10 Oct 2008 16:58:05 -0400 Received: from us-ex1.zend.com ([192.168.16.5]) by il-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 10 Oct 2008 22:58:19 +0200 Received: from [192.168.16.110] ([192.168.16.110]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 10 Oct 2008 13:58:16 -0700 Message-ID: <48EFC1E8.5030702@zend.com> Date: Fri, 10 Oct 2008 13:58:16 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: Lukas Kahwe Smith CC: Timm Friebe , Marcus Boerger , internals@lists.php.net, =?ISO-8859-1?Q?Johannes_Schl=FCter?= References: <01d401c8fe5e$6bc9d730$16b2a8c0@kartofel> <022101c8fe5f$4a3e3c40$16b2a8c0@kartofel> <1901158190.20080815120657@marcus-boerger.de> <7EB12BC1-41F1-458C-8017-9AB4D910CAA5@pooteeweet.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 10 Oct 2008 20:58:16.0491 (UTC) FILETIME=[EAC84FB0:01C92B1A] Subject: Re: [PHP-DEV] __getStatic From: stas@zend.com (Stanislav Malyshev) Hi! >> I've updated the patch and added some tests with it. >> >> http://sitten-polizei.de/php/getstatic.diff Looked at the patch. There's some things I noticed there: 1. _getstatic->common.fn_flags |= ~ZEND_ACC_ALLOW_STATIC; What was the idea here? Maybe ~ is not intended? 2. Do we really need ZEND_ASSIGN_CLASS opcode, can't we reuse ASSIGN_OBJ with flag, as we do for fetches? 3. In zend_std_set_static_property, I'm not sure we need to do zend_update_class_constants there. We won't be using any values from it. 4. In zend_std_set_static_property, why you create new property_info two times when property does not exist? 5. In zend_std_set_static_property, old value of the property is not destroyed. Also, I'm not sure separation is handled there correctly - previous value may be shared between variables, and just replacing it would affect all shared variables. You may see how property handler does assignments. Alternatively, in the absence of the setter, you may just use the existing assignment handler, just fetching the zval** as before and passing it to zend_assign_to_variable. This would probably be better - less stuff to do. 6. What would happen with foo::$bar += 1? I don't see assign-ops handled anywhere in the patch. 7. Does zend_std_get_static_property handle the case of return by-ref like property one does? -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com