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

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to