Re: cvs: php-src(PHP_5_1) /ext/simplexml simplexml.c /ext/tidy tidy.c /ext/xmlreader php_xmlreader.c /ext/xmlwriter php_xmlwriter.c

From: Date: Mon, 03 Apr 2006 16:10:41 +0000
Subject: Re: cvs: php-src(PHP_5_1) /ext/simplexml simplexml.c /ext/tidy tidy.c /ext/xmlreader php_xmlreader.c /ext/xmlwriter php_xmlwriter.c
References: 1 2  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-37644@lists.php.net to get a copy of this message
On 03.04.2006 19:40, Rasmus Lerdorf wrote:
Antony Dovgal wrote:
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 1 && PHP_RELEASE_VERSION > 2) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5) zend_object_std_dtor(&intern->std TSRMLS_CC);
What about PHP 6?
What about it? PHP6 has these functions and btw this #ifdef handles PHP6 too. But I think this solution is temporary and we'll change it as soon as we get 5.2.
How about adding a #define ZEND_OBJECT_STD_DTOR 1 next to the function definition of this function to make this check much cleaner. And I would also suggest for any extension that needs this it would be easier to document a block like: #ifndef ZEND_OBJECT_STD_DTOR void zend_object_std_dtor(zend_object *object TSRMLS_DC) {
     if (object->guards) {
         zend_hash_destroy(object->guards);
         FREE_HASHTABLE(object->guards);
     }
     if (object->properties) {
         zend_hash_destroy(object->properties);
         FREE_HASHTABLE(object->properties);
     }
} #endif
Personally I don't see how this approach is cleaner/better.
That people can add to their .h file and then simply use zend_object_std_dtor() throughout. Same for zend_object_std_init I guess. If you look at something like pecl/sdo, this is needed in a bunch of places there.
-- Wbr, Antony Dovgal

« previous php.cvs (#37644) next »