Hi, > -----Original Message----- > From: Michael Wallner [mailto:[EMAIL PROTECTED] > Sent: Tuesday, August 30, 2005 1:56 PM > To: internals@lists.php.net; Dmitry Stogov > Cc: internals@lists.php.net; Andi Gutmans > Subject: [PHP-DEV] Re: Constants and static methods for > internal classes > > > Hi Dmitry Stogov, you wrote: > > > The patch is maden for "easiest" usage and it doesn't > support internal > > array/constants properties (they weren't supported before). > > So why burden the weigh of allocation, initialization, > destruction and freeing on the extension developer? This > will force every extension writer to implement a kind of my > dup_zval() function, wouldn't it?
Static members works with this patch (except array and constant properties) without any additional requirements for extension. See test extension in first email. Developer should just call zend_declare_property_...() or zend_declare_class_constant_...() in MINIT (no any special allocation, initialization, destruction and freeing are required). To support arrays and constants API should be extended with zend_declare_property_constant() zend_declare_class_constant_constant() zend_declare_property_constant_array() zend_declare_class_constant_constant_array() init_constant_array() constant_array_add_assoc_...() constant_array_index_insert_...() constant_array_next_inex_insert_...() Do we need this? > And as there's not much > reference devs will spam the list on how to use static > properties right. I think we could avoid this by stretching > the minimalistic approach a bit and provide at least a > zend_init_static_properties(). We already have zend_declare_property_...() those are good enough to declare both static and non-static properties. Why we need new functions? Dmitry. > Thanks a lot, > -- > Michael - < mike(@)php.net > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php