Index: ext/tidy/tidy.c =================================================================== RCS file: /repository/php-src/ext/tidy/tidy.c,v retrieving revision 1.66.2.6 diff -u -p -d -r1.66.2.6 tidy.c --- ext/tidy/tidy.c 29 Mar 2006 14:28:42 -0000 1.66.2.6 +++ ext/tidy/tidy.c 3 Apr 2006 14:37:26 -0000 @@ -530,7 +530,19 @@ static void tidy_object_free_storage(voi { PHPTidyObj *intern = (PHPTidyObj *)object; +#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); +#else + if (intern->std.guards) { + zend_hash_destroy(intern->std.guards); + FREE_HASHTABLE(intern->std.guards); + } + + if (intern->std.properties) { + zend_hash_destroy(intern->std.properties); + FREE_HASHTABLE(intern->std.properties); + } +#endif if (intern->ptdoc) { intern->ptdoc->ref_count--; @@ -554,8 +566,16 @@ static void tidy_object_new(zend_class_e intern = emalloc(sizeof(PHPTidyObj)); memset(intern, 0, sizeof(PHPTidyObj)); - +#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_init(&intern->std, class_type TSRMLS_CC); +#else + ALLOC_HASHTABLE(intern->std.properties); + zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0); + + intern->std.ce = class_type; + intern->std.guards = NULL; +#endif + zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); switch(objtype) { Index: ext/simplexml/simplexml.c =================================================================== RCS file: /repository/php-src/ext/simplexml/simplexml.c,v retrieving revision 1.151.2.19 diff -u -p -d -r1.151.2.19 simplexml.c --- ext/simplexml/simplexml.c 29 Mar 2006 14:28:42 -0000 1.151.2.19 +++ ext/simplexml/simplexml.c 3 Apr 2006 14:37:26 -0000 @@ -1785,8 +1785,20 @@ static void sxe_object_free_storage(void sxe = (php_sxe_object *) object; +#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(&sxe->zo TSRMLS_CC); - +#else + if (sxe->zo.guards) { + zend_hash_destroy(sxe->zo.guards); + FREE_HASHTABLE(sxe->zo.guards); + } + + if (sxe->zo.properties) { + zend_hash_destroy(sxe->zo.properties); + FREE_HASHTABLE(sxe->zo.properties); + } +#endif + php_libxml_node_decrement_resource((php_libxml_node_object *)sxe TSRMLS_CC); if (sxe->xpath) { @@ -1814,7 +1826,15 @@ static php_sxe_object* php_sxe_object_ne intern->iter.nsprefix = NULL; intern->iter.name = NULL; +#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_init(&intern->zo, ce TSRMLS_CC); +#else + ALLOC_HASHTABLE(intern->zo.properties); + zend_hash_init(intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0); + + intern->zo.ce = ce; + intern->zo.guards = NULL; +#endif return intern; } Index: ext/xmlwriter/php_xmlwriter.c =================================================================== RCS file: /repository/php-src/ext/xmlwriter/php_xmlwriter.c,v retrieving revision 1.20.2.11 diff -u -p -d -r1.20.2.11 php_xmlwriter.c --- ext/xmlwriter/php_xmlwriter.c 29 Mar 2006 14:28:43 -0000 1.20.2.11 +++ ext/xmlwriter/php_xmlwriter.c 3 Apr 2006 14:37:26 -0000 @@ -77,8 +77,21 @@ static void xmlwriter_object_free_storag xmlwriter_free_resource_ptr(intern->xmlwriter_ptr TSRMLS_CC); } intern->xmlwriter_ptr = NULL; + +#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->zo TSRMLS_CC); - +#else + if (intern->zo.guards) { + zend_hash_destroy(intern->zo.guards); + FREE_HASHTABLE(intern->zo.guards); + } + + if (intern->zo.properties) { + zend_hash_destroy(intern->zo.properties); + FREE_HASHTABLE(intern->zo.properties); + } +#endif + efree(intern); } /* }}} */ @@ -94,8 +107,17 @@ PHP_XMLWRITER_API zend_object_value xmlw intern = emalloc(sizeof(ze_xmlwriter_object)); memset(&intern->zo, 0, sizeof(zend_object)); intern->xmlwriter_ptr = NULL; - + +#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_init(&intern->zo, class_type TSRMLS_CC); +#else + ALLOC_HASHTABLE(intern->zo.properties); + zend_hash_init(intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0); + + intern->zo.ce = class_type; + intern->zo.guards = NULL; +#endif + zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); Index: ext/xmlreader/php_xmlreader.c =================================================================== RCS file: /repository/php-src/ext/xmlreader/php_xmlreader.c,v retrieving revision 1.13.2.12 diff -u -p -d -r1.13.2.12 php_xmlreader.c --- ext/xmlreader/php_xmlreader.c 29 Mar 2006 14:28:43 -0000 1.13.2.12 +++ ext/xmlreader/php_xmlreader.c 3 Apr 2006 14:37:27 -0000 @@ -377,8 +377,20 @@ void xmlreader_objects_free_storage(void { xmlreader_object *intern = (xmlreader_object *)object; +#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); - +#else + if (intern->std.guards) { + zend_hash_destroy(intern->std.guards); + FREE_HASHTABLE(intern->std.guards); + } + + if (intern->std.properties) { + zend_hash_destroy(intern->std.properties); + FREE_HASHTABLE(intern->std.properties); + } +#endif + xmlreader_free_resources(intern); efree(object); @@ -398,7 +410,16 @@ zend_object_value xmlreader_objects_new( intern->schema = NULL; intern->prop_handler = &xmlreader_prop_handlers; +#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_init(&intern->std, class_type TSRMLS_CC); +#else + ALLOC_HASHTABLE(intern->std.properties); + zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0); + + intern->std.ce = class_type; + intern->std.guards = NULL; +#endif + zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) xmlreader_objects_free_storage, xmlreader_objects_clone TSRMLS_CC); intern->handle = retval.handle;