Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:11457 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57853 invoked by uid 1010); 22 Jul 2004 06:16:18 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 57827 invoked from network); 22 Jul 2004 06:16:18 -0000 Received: from unknown (HELO mail.zend.com) (80.74.107.235) by pb1.pair.com with SMTP; 22 Jul 2004 06:16:18 -0000 Received: (qmail 18271 invoked from network); 22 Jul 2004 06:16:16 -0000 Received: from localhost (HELO AndiNotebook.zend.com) (127.0.0.1) by localhost with SMTP; 22 Jul 2004 06:16:16 -0000 Message-ID: <5.1.0.14.2.20040721231339.0272f008@127.0.0.1> X-Sender: andi@127.0.0.1 X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Wed, 21 Jul 2004 23:16:10 -0700 To: Andrei Zmievski ,Zeev Suraski , stas@zend.com Cc: PHP Internals In-Reply-To: <20040722060130.GA10387@hyperion.gravitonic.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: Internal properties From: andi@zend.com (Andi Gutmans) References: <20040722060130.GA10387@hyperion.gravitonic.com> At 11:01 PM 7/21/2004 -0700, Andrei Zmievski wrote: >Hi, > >I saw this in zend_opcode.c zend_cleanup_class_data(): > > /* Note that only run-time accessed data need to be cleaned up, > * pre-defined data can not contain objects and thus are > not probelmatic */ > >Which lead me to look into zend_declare_property() and I noticed that >you cannot declare properties that are objects/arrays/resources. Is >there a good reason for disallowing extension authors to do that? The problem is that objects and resources can't really stay alive in between requests because those mechanisms are shutdown at rshutdown. Arrays also can't stay alive because they need to be emalloc()'ed or they won't work with the engine. I think it'd be quite complex to change this behavior and the work around probably needs to be in the extension depending on how bad it is to recreate these or somehow cache them for rinit. >Alternatively, do you suggest using zend_hash_update() on class >properties even though I really need this property to be static so its >shared by all instances of the class? If these are per-request statics it can probably be solved. Andi