]> granicus.if.org Git - php/commitdiff
Made server wide switch for unicode on/off (according to PDM).
authorDmitry Stogov <dmitry@php.net>
Mon, 13 Feb 2006 10:23:59 +0000 (10:23 +0000)
committerDmitry Stogov <dmitry@php.net>
Mon, 13 Feb 2006 10:23:59 +0000 (10:23 +0000)
59 files changed:
Zend/zend.c
Zend/zend.h
Zend/zend_API.c
Zend/zend_API.h
Zend/zend_compile.h
Zend/zend_exceptions.c
Zend/zend_globals.h
Zend/zend_hash.c
Zend/zend_hash.h
Zend/zend_ini.h
Zend/zend_ini_parser.y
Zend/zend_ini_scanner.h
Zend/zend_ini_scanner.l
Zend/zend_interfaces.c
Zend/zend_object_handlers.c
Zend/zend_operators.c
ext/com_dotnet/com_misc.c
ext/dom/attr.c
ext/dom/cdatasection.c
ext/dom/characterdata.c
ext/dom/comment.c
ext/dom/document.c
ext/dom/documentfragment.c
ext/dom/dom_iterators.c
ext/dom/domexception.c
ext/dom/domimplementation.c
ext/dom/element.c
ext/dom/entityreference.c
ext/dom/namednodemap.c
ext/dom/node.c
ext/dom/nodelist.c
ext/dom/php_dom.c
ext/dom/processinginstruction.c
ext/dom/text.c
ext/dom/xpath.c
ext/pdo/pdo.c
ext/pdo/pdo_dbh.c
ext/pdo/pdo_stmt.c
ext/pdo/php_pdo_phpvers_compat.h
ext/reflection/php_reflection.c
ext/session/tests/015.phpt
ext/session/tests/020.phpt
ext/simplexml/simplexml.c
ext/spl/php_spl.c
ext/spl/spl_array.c
ext/spl/spl_directory.c
ext/spl/spl_iterators.c
ext/sqlite/sqlite.c
ext/standard/array.c
ext/standard/dir.c
ext/unicode/unicode_iterators.c
main/SAPI.c
main/SAPI.h
main/php_ini.c
main/php_variables.c
sapi/cgi/cgi_main.c
sapi/cli/php_cli.c
tests/lang/bug25145.phpt
tests/run-test/test004.phpt

index f52942ab148c7fce563fe31c295c6aa59c6bbac2..ca3eb8c79a7fb908b80fdb2ca5e9f0deff0003b2 100644 (file)
 #include "zend_builtin_functions.h"
 #include "zend_ini.h"
 #include "zend_unicode.h"
-#include "zend_interfaces.h"
+
+#ifdef ZTS
+#   define GLOBAL_FUNCTION_TABLE    global_function_table
+#   define GLOBAL_CLASS_TABLE       global_class_table
+#   define GLOBAL_CONSTANTS_TABLE   global_constants_table
+#   define GLOBAL_AUTO_GLOBALS_TABLE    global_auto_globals_table
+#else
+#   define GLOBAL_FUNCTION_TABLE    CG(function_table)
+#   define GLOBAL_CLASS_TABLE       CG(class_table)
+#   define GLOBAL_AUTO_GLOBALS_TABLE    CG(auto_globals)
+#   define GLOBAL_CONSTANTS_TABLE   EG(zend_constants)
+#endif
 
 #if defined(ZEND_WIN32) && ZEND_DEBUG
 BOOL WINAPI IsDebuggerPresent(VOID);
@@ -211,16 +222,12 @@ ZEND_INI_END()
 ZEND_API int compiler_globals_id;
 ZEND_API int executor_globals_id;
 ZEND_API int alloc_globals_id;
-#endif
 static HashTable *global_function_table = NULL;
 static HashTable *global_class_table = NULL;
 static HashTable *global_constants_table = NULL;
 static HashTable *global_auto_globals_table = NULL;
-static HashTable *global_u_function_table = NULL;
-static HashTable *global_u_class_table = NULL;
-static HashTable *global_u_constants_table = NULL;
-static HashTable *global_u_auto_globals_table = NULL;
 static HashTable *global_persistent_list = NULL;
+#endif
 
 ZEND_API zend_utility_values zend_uv;
 
@@ -373,7 +380,7 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop
 
        if (
          /* UTODO: clean this up */
-           (expr->type == IS_STRING && 
+           (expr->type == IS_STRING &&
            (!strcmp(ucnv_getName(ZEND_U_CONVERTER(UG(output_encoding_conv)), &temp),
                                 ucnv_getName(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &temp))))) {
                *use_copy = 0;
@@ -648,13 +655,12 @@ static void zend_set_default_compile_time_values(TSRMLS_D)
 
 static void zval_copy_persistent(zval *zv)
 {
-       if (Z_TYPE_P(zv) == IS_UNICODE) {
-               Z_USTRVAL_P(zv) = zend_ustrndup(Z_USTRVAL_P(zv), Z_USTRLEN_P(zv));
-       } else if (Z_TYPE_P(zv) == IS_STRING || Z_TYPE_P(zv) == IS_CONSTANT) {
+       if (Z_TYPE_P(zv) == IS_STRING || Z_TYPE_P(zv) == IS_CONSTANT) {
                UChar *ustr;
 
                ustr = malloc(UBYTES(Z_STRLEN_P(zv)+1));
                u_charsToUChars(Z_STRVAL_P(zv), ustr, Z_STRLEN_P(zv)+1);
+               free(Z_STRVAL_P(zv));
                Z_USTRVAL_P(zv) = ustr;
                if (Z_TYPE_P(zv) == IS_STRING) Z_TYPE_P(zv) = IS_UNICODE;
        }
@@ -673,14 +679,14 @@ static void zend_u_function_dtor(zend_function *function)
                        int n = function->common.num_args;
 
                        while (n > 0) {
-                       --n;
-                         if (function->common.arg_info[n].name) {
-                               free(function->common.arg_info[n].name);
-                         }
-                         if (function->common.arg_info[n].class_name) {
+                               --n;
+                               if (function->common.arg_info[n].name) {
+                                       free(function->common.arg_info[n].name);
+                               }
+                               if (function->common.arg_info[n].class_name) {
                                        free(function->common.arg_info[n].class_name);
                                }
-                 }
+                       }
                        free(function->common.arg_info);
                }
        }
@@ -696,15 +702,7 @@ static void free_u_zend_constant(zend_constant *c)
        free(c->name);
 }
 
-static void copy_u_zend_constant(zend_constant *c)
-{
-       c->name = (char*)zend_ustrndup((UChar*)c->name, c->name_len - 1);
-       if (!(c->flags & CONST_PERSISTENT)) {
-               zval_copy_ctor(&c->value);
-       }
-}
-
-static void function_to_unicode(zend_function *func)
+static void function_to_unicode(zend_function *func TSRMLS_DC)
 {
        if (func->common.function_name) {
                UChar *uname;
@@ -737,26 +735,22 @@ static void function_to_unicode(zend_function *func)
        }
 }
 
-static void property_info_to_unicode(zend_property_info *info)
+static void property_info_to_unicode(zend_property_info *info TSRMLS_DC)
 {
        if (info->name) {
                UChar *uname;
 
                uname = malloc(UBYTES(info->name_length+1));
                u_charsToUChars(info->name, uname, info->name_length+1);
+               free(info->name);
                info->name = (char*)uname;
                info->h = zend_u_get_hash_value(IS_UNICODE, info->name, info->name_length+1);
        }
 }
 
-static void zval_ptr_to_unicode(zval **zv)
+static void zval_ptr_to_unicode(zval **zv TSRMLS_DC)
 {
-       zval *new_zv = malloc(sizeof(zval));
-
-       memcpy(new_zv, *zv, sizeof(zval));
-       new_zv->refcount = 1;
-       zval_copy_persistent(new_zv);
-       *zv = new_zv;
+       zval_copy_persistent(*zv);
 }
 
 static void const_to_unicode(zend_constant *c)
@@ -766,157 +760,36 @@ static void const_to_unicode(zend_constant *c)
        if (c->name) {
                uname = malloc(UBYTES(c->name_len));
                u_charsToUChars(c->name, uname, c->name_len);
+               free(c->name);
                c->name = (char*)uname;
        }
-       zval_copy_persistent(&c->value);
-}
-
-static void class_to_unicode(zend_class_entry **ce)
-{
-       zend_class_entry *new_ce = malloc(sizeof(zend_class_entry));
-       zend_property_info tmp_info;
-       zval* tmp_zval;
-
-       memcpy(new_ce, *ce, sizeof(zend_class_entry));
-       (*ce)->u_twin = new_ce;
-
-       /* Convert name to unicode */
-       if (new_ce->name) {
-               UChar *uname = malloc(UBYTES(new_ce->name_length+1));
-
-               u_charsToUChars(new_ce->name, uname, new_ce->name_length+1);
-               new_ce->name = (char*)uname;
-       }
-
-       /* Copy methods */
-       zend_u_hash_init_ex(&new_ce->function_table, (*ce)->function_table.nNumOfElements, NULL, ZEND_U_FUNCTION_DTOR, 1, 1, 0);
-       {
-               Bucket *p = (*ce)->function_table.pListHead;
-               while (p != NULL) {
-                       zend_function *src = (zend_function*)p->pData;
-                       zend_function *target;
-                       zend_function tmp_func = *src;
-
-                       function_to_unicode(&tmp_func);
-                       
-                       zend_hash_add(&new_ce->function_table, p->key.u.string, p->nKeyLength, &tmp_func, sizeof(zend_function), (void**)&target);
-                       src->common.u_twin = target;
-
-                 p = p->pListNext;
-               }
-       }
-/*
-       zend_hash_copy(&new_ce->function_table, &(*ce)->function_table, (copy_ctor_func_t) function_to_unicode, &tmp_func, sizeof(zend_function));
-*/
-       /* Copy constants */
-       zend_u_hash_init_ex(&new_ce->constants_table, (*ce)->constants_table.nNumOfElements, NULL, (*ce)->constants_table.pDestructor, 1, 1, 0);
-       zend_hash_copy(&new_ce->constants_table, &(*ce)->constants_table, (copy_ctor_func_t) zval_ptr_to_unicode, &tmp_zval, sizeof(zval*));
-
-       /* Copy properties */
-       zend_u_hash_init_ex(&new_ce->properties_info, (*ce)->properties_info.nNumOfElements, NULL, (*ce)->properties_info.pDestructor/*(dtor_func_t)zend_destroy_property_info_internal*/, 1, 1, 0);
-       zend_hash_copy(&new_ce->properties_info, &(*ce)->properties_info, (copy_ctor_func_t) property_info_to_unicode, &tmp_info, sizeof(zend_property_info));
-
-       zend_u_hash_init_ex(&new_ce->default_properties, (*ce)->default_properties.nNumOfElements, NULL, (*ce)->default_properties.pDestructor, 1, 1, 0);
-       zend_hash_copy(&new_ce->default_properties, &(*ce)->default_properties, (copy_ctor_func_t) zval_ptr_to_unicode, &tmp_zval, sizeof(zval*));
-
-       zend_u_hash_init_ex(&new_ce->default_static_members, (*ce)->default_static_members.nNumOfElements, NULL, (*ce)->default_static_members.pDestructor, 1, 1, 0);
+       if (Z_TYPE(c->value) == IS_STRING || Z_TYPE(c->value) == IS_CONSTANT) {
+               UChar *ustr;
 
-       {
-               HashPosition pos;
-               zval **p;
-
-               zend_hash_internal_pointer_reset_ex(&(*ce)->default_static_members, &pos);
-               while (zend_hash_get_current_data_ex(&(*ce)->default_static_members, (void**)&p, &pos) == SUCCESS) {
-                       char *str_index;
-                       uint str_length;
-                       ulong num_index;
-                       zval **q;
-
-                       zend_hash_get_current_key_ex(&(*ce)->default_static_members, &str_index, &str_length, &num_index, 0, &pos);
-                       if ((*p)->is_ref &&
-                           (*ce)->parent &&
-                           zend_hash_find(&(*ce)->parent->default_static_members, str_index, str_length, (void**)&q) == SUCCESS &&
-                           *p == *q &&
-                           zend_hash_find(&new_ce->parent->u_twin->default_static_members, str_index, str_length, (void**)&q) == SUCCESS) {
-                               (*q)->refcount++;
-                               (*q)->is_ref = 1;
-                               zend_hash_add(&new_ce->default_static_members, str_index, str_length, (void**)q, sizeof(zval*), NULL);
-                       } else {
-                               zval *q = *p;
-                               zval_ptr_to_unicode(&q);
-                               q->is_ref = 0;
-                               zend_hash_add(&new_ce->default_static_members, str_index, str_length, (void**)&q, sizeof(zval*), NULL);
-                       }
-                       zend_hash_move_forward_ex(&(*ce)->default_static_members, &pos);
-               }
+               ustr = malloc(UBYTES(Z_STRLEN(c->value)+1));
+               u_charsToUChars(Z_STRVAL(c->value), ustr, Z_STRLEN(c->value)+1);
+               Z_USTRVAL(c->value) = ustr;
+               if (Z_TYPE(c->value) == IS_STRING) Z_TYPE(c->value) = IS_UNICODE;
        }
-
-       *ce = new_ce;
 }
 
-static void fix_classes(HashTable *ht) {
-       Bucket *p = ht->pListHead;
-       Bucket *q;
-
-       /* Fix parent classes */
-       while (p != NULL) {
-               zend_class_entry *ce = *(zend_class_entry**)p->pData;
-
-               if (ce->parent) {
-                       ce->parent = ce->parent->u_twin;
-               }
-               if (ce->num_interfaces > 0 && ce->interfaces) {
-                       int i = sizeof(zend_class_entry*)*ce->num_interfaces;
-                       zend_class_entry **new_interfaces;
-
-                       new_interfaces = (zend_class_entry**)malloc(i);
-                       memcpy(new_interfaces, ce->interfaces, i);
-                       ce->interfaces = new_interfaces;
-                       for (i = 0; i < ce->num_interfaces; i++) {
-                               ce->interfaces[i] = ce->interfaces[i]->u_twin;
-                       }
-               }
-               
-               q = ce->function_table.pListHead;
-               while (q != NULL) {
-                       zend_function *f = (zend_function*)q->pData;
-
-                       if (f->common.scope) {
-                               f->common.scope = f->common.scope->u_twin;
-                       }                       
-                       if (f->common.prototype) {
-                               f->common.prototype = f->common.prototype->common.u_twin;
-                       }
-                       q = q->pListNext;
-               }
-
-               if (ce->constructor) {
-                       ce->constructor = ce->constructor->common.u_twin;
-               } else if (ce->destructor) {
-                       ce->destructor = ce->destructor->common.u_twin;
-               } else if (ce->clone) {
-                       ce->clone = ce->clone->common.u_twin;
-               } else if (ce->__get) {
-                       ce->__get = ce->__get->common.u_twin;
-               } else if (ce->__set) {
-                       ce->__set = ce->__set->common.u_twin;
-               } else if (ce->__unset) {
-                       ce->__unset = ce->__unset->common.u_twin;
-               } else if (ce->__isset) {
-                       ce->__isset = ce->__isset->common.u_twin;
-               } else if (ce->__call) {
-                       ce->__call = ce->__call->common.u_twin;
-               } else if (ce->__tostring) {
-                       ce->__tostring = ce->__tostring->common.u_twin;
-               } else if (ce->serialize_func) {
-                       ce->serialize_func = ce->serialize_func->common.u_twin;
-               } else if (ce->unserialize_func) {
-                       ce->unserialize_func = ce->unserialize_func->common.u_twin;
-               }
+static void class_to_unicode(zend_class_entry **ce TSRMLS_DC)
+{
+       /* Convert name to unicode */
+       if ((*ce)->name) {
+               UChar *uname = malloc(UBYTES((*ce)->name_length+1));
 
-               p = p->pListNext;
+               u_charsToUChars((*ce)->name, uname, (*ce)->name_length+1);
+               free((*ce)->name);
+               (*ce)->name = (char*)uname;
        }
 
+       zend_hash_to_unicode(&(*ce)->function_table, (apply_func_t)function_to_unicode TSRMLS_CC);
+       (*ce)->function_table.pDestructor = ZEND_U_FUNCTION_DTOR;
+       zend_hash_to_unicode(&(*ce)->constants_table, (apply_func_t)zval_ptr_to_unicode TSRMLS_CC);
+       zend_hash_to_unicode(&(*ce)->properties_info, (apply_func_t)property_info_to_unicode TSRMLS_CC);
+       zend_hash_to_unicode(&(*ce)->default_properties, (apply_func_t)zval_ptr_to_unicode TSRMLS_CC);
+       zend_hash_to_unicode(&(*ce)->default_static_members, (apply_func_t)zval_ptr_to_unicode TSRMLS_CC);
 }
 
 #ifdef ZTS
@@ -927,46 +800,23 @@ static void compiler_globals_ctor(zend_compiler_globals *compiler_globals TSRMLS
 
        compiler_globals->compiled_filename = NULL;
 
-       compiler_globals->global_function_table = compiler_globals->function_table = (HashTable *) malloc(sizeof(HashTable));
-       zend_u_hash_init_ex(compiler_globals->function_table, 100, NULL, ZEND_FUNCTION_DTOR, 1, 0, 0);
+       compiler_globals->function_table = (HashTable *) malloc(sizeof(HashTable));
+       zend_u_hash_init_ex(compiler_globals->function_table, 100, NULL, ZEND_FUNCTION_DTOR, 1, UG(unicode), 0);
        zend_hash_copy(compiler_globals->function_table, global_function_table, NULL, &tmp_func, sizeof(zend_function));
 
-       if (global_u_function_table) {
-               compiler_globals->global_u_function_table = (HashTable *) malloc(sizeof(HashTable));
-               zend_u_hash_init_ex(compiler_globals->global_u_function_table, 100, NULL, ZEND_FUNCTION_DTOR, 1, 1, 0);
-               zend_hash_copy(compiler_globals->global_u_function_table, global_u_function_table, NULL, &tmp_func, sizeof(zend_function));
-       } else {
-               compiler_globals->global_u_function_table = 0;
-       }
-
-       compiler_globals->global_class_table = compiler_globals->class_table = (HashTable *) malloc(sizeof(HashTable));
-       zend_u_hash_init_ex(compiler_globals->class_table, 10, NULL, ZEND_CLASS_DTOR, 1, 0, 0);
+       compiler_globals->class_table = (HashTable *) malloc(sizeof(HashTable));
+       zend_u_hash_init_ex(compiler_globals->class_table, 10, NULL, ZEND_CLASS_DTOR, 1, UG(unicode), 0);
        zend_hash_copy(compiler_globals->class_table, global_class_table, (copy_ctor_func_t) zend_class_add_ref, &tmp_class, sizeof(zend_class_entry *));
 
-       if (global_u_class_table) {
-               compiler_globals->global_u_class_table =  (HashTable *) malloc(sizeof(HashTable));
-               zend_u_hash_init_ex(compiler_globals->global_u_class_table, 10, NULL, ZEND_CLASS_DTOR, 1, 1, 0);
-               zend_hash_copy(compiler_globals->global_u_class_table, global_u_class_table, (copy_ctor_func_t) zend_class_add_ref, &tmp_class, sizeof(zend_class_entry *));
-       } else {
-               compiler_globals->global_u_class_table = NULL;
-       }
        zend_set_default_compile_time_values(TSRMLS_C);
 
        CG(interactive) = 0;
        CG(literal_type) = IS_STRING;
 
-       compiler_globals->global_auto_globals_table = compiler_globals->auto_globals = (HashTable *) malloc(sizeof(HashTable));
-       zend_u_hash_init_ex(compiler_globals->auto_globals, 8, NULL, NULL, 1, 0, 0);
+       compiler_globals->auto_globals = (HashTable *) malloc(sizeof(HashTable));
+       zend_u_hash_init_ex(compiler_globals->auto_globals, 8, NULL, NULL, 1, UG(unicode), 0);
        zend_hash_copy(compiler_globals->auto_globals, global_auto_globals_table, NULL, NULL, sizeof(zend_auto_global) /* empty element */);
 
-       if (global_u_auto_globals_table) {
-               compiler_globals->global_u_auto_globals_table = (HashTable *) malloc(sizeof(HashTable));
-               zend_u_hash_init_ex(compiler_globals->global_u_auto_globals_table, 8, NULL, NULL, 1, 1, 0);
-               zend_hash_copy(compiler_globals->global_u_auto_globals_table, global_u_auto_globals_table, NULL, NULL, sizeof(zend_auto_global) /* empty element */);
-       } else {
-               compiler_globals->global_u_auto_globals_table = NULL;
-       }
-
        compiler_globals->last_static_member = zend_hash_num_elements(compiler_globals->class_table);
        if (compiler_globals->last_static_member) {
                compiler_globals->static_members = (HashTable**)calloc(compiler_globals->last_static_member, sizeof(HashTable*));
@@ -978,38 +828,17 @@ static void compiler_globals_ctor(zend_compiler_globals *compiler_globals TSRMLS
 
 static void compiler_globals_dtor(zend_compiler_globals *compiler_globals TSRMLS_DC)
 {
-       if (compiler_globals->function_table != global_function_table &&
-           compiler_globals->function_table != global_u_function_table) {
-               if (compiler_globals->global_function_table) {
-                       zend_hash_destroy(compiler_globals->global_function_table);
-                       free(compiler_globals->global_function_table);
-               }
-               if (compiler_globals->global_u_function_table) {
-                       zend_hash_destroy(compiler_globals->global_u_function_table);
-                       free(compiler_globals->global_u_function_table);
-               }
+       if (compiler_globals->function_table != GLOBAL_FUNCTION_TABLE) {
+               zend_hash_destroy(compiler_globals->function_table);
+               free(compiler_globals->function_table);
        }
-       if (compiler_globals->class_table != global_class_table &&
-           compiler_globals->class_table != global_u_class_table) {
-               if (compiler_globals->global_class_table) {
-                       zend_hash_destroy(compiler_globals->global_class_table);
-                       free(compiler_globals->global_class_table);
-               }
-               if (compiler_globals->global_u_class_table) {
-                       zend_hash_destroy(compiler_globals->global_u_class_table);
-                       free(compiler_globals->global_u_class_table);
-               }
+       if (compiler_globals->class_table != GLOBAL_CLASS_TABLE) {
+               zend_hash_destroy(compiler_globals->class_table);
+               free(compiler_globals->class_table);
        }
-       if (compiler_globals->auto_globals != global_auto_globals_table &&
-           compiler_globals->auto_globals != global_u_auto_globals_table) {
-               if (compiler_globals->global_auto_globals_table) {
-                       zend_hash_destroy(compiler_globals->global_auto_globals_table);
-                       free(compiler_globals->global_auto_globals_table);
-               }
-               if (compiler_globals->global_u_auto_globals_table) {
-                       zend_hash_destroy(compiler_globals->global_u_auto_globals_table);
-                       free(compiler_globals->global_u_auto_globals_table);
-               }
+       if (compiler_globals->auto_globals != GLOBAL_AUTO_GLOBALS_TABLE) {
+               zend_hash_destroy(compiler_globals->auto_globals);
+               free(compiler_globals->auto_globals);
        }
        if (compiler_globals->static_members) {
                free(compiler_globals->static_members);
@@ -1020,20 +849,8 @@ static void compiler_globals_dtor(zend_compiler_globals *compiler_globals TSRMLS
 
 static void executor_globals_ctor(zend_executor_globals *executor_globals TSRMLS_DC)
 {
-       zend_constant tmp_const;
-
        zend_startup_constants(TSRMLS_C);
-       zend_copy_constants(EG(zend_constants), global_constants_table);
-       EG(global_constants_table) = EG(zend_constants);
-
-       if (global_u_constants_table) {
-               EG(global_u_constants_table) = (HashTable *) malloc(sizeof(HashTable));
-               zend_u_hash_init_ex(EG(global_u_constants_table), global_u_constants_table->nNumOfElements, NULL, ZEND_CONSTANT_DTOR, 1, 1, 0);
-               zend_hash_copy(EG(global_u_constants_table), global_u_constants_table, (copy_ctor_func_t) copy_u_zend_constant, &tmp_const, sizeof(zend_constant));
-       } else {
-               EG(global_u_constants_table) = NULL;
-       }
-
+       zend_copy_constants(EG(zend_constants), GLOBAL_CONSTANTS_TABLE);
        zend_init_rsrc_plist(TSRMLS_C);
        EG(lambda_count)=0;
        EG(user_error_handler) = NULL;
@@ -1051,16 +868,9 @@ static void executor_globals_dtor(zend_executor_globals *executor_globals TSRMLS
        if (&executor_globals->persistent_list != global_persistent_list) {
                zend_destroy_rsrc_list(&executor_globals->persistent_list TSRMLS_CC);
        }
-       if (executor_globals->global_constants_table != global_constants_table &&
-           executor_globals->global_u_constants_table != global_u_function_table) {
-               if (executor_globals->global_constants_table) {
-                       zend_hash_destroy(executor_globals->global_constants_table);
-                       free(executor_globals->global_constants_table);
-               }
-               if (executor_globals->global_u_constants_table) {
-                       zend_hash_destroy(executor_globals->global_u_constants_table);
-                       free(executor_globals->global_u_constants_table);
-               }
+       if (executor_globals->zend_constants != GLOBAL_CONSTANTS_TABLE) {
+               zend_hash_destroy(executor_globals->zend_constants);
+               free(executor_globals->zend_constants);
        }
 }
 
@@ -1082,6 +892,7 @@ static void alloc_globals_ctor(zend_alloc_globals *alloc_globals_p TSRMLS_DC)
        start_memory_manager(TSRMLS_C);
 }
 
+
 #if defined(__FreeBSD__) || defined(__DragonFly__)
 /* FreeBSD and DragonFly floating point precision fix */
 #include <floatingpoint.h>
@@ -1201,15 +1012,15 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
        zend_version_info = strdup(ZEND_CORE_VERSION_INFO);
        zend_version_info_length = sizeof(ZEND_CORE_VERSION_INFO)-1;
 
-       global_function_table = (HashTable *) malloc(sizeof(HashTable));
-       global_class_table = (HashTable *) malloc(sizeof(HashTable));
-       global_auto_globals_table = (HashTable *) malloc(sizeof(HashTable));
-       global_constants_table = (HashTable *) malloc(sizeof(HashTable));
+       GLOBAL_FUNCTION_TABLE = (HashTable *) malloc(sizeof(HashTable));
+       GLOBAL_CLASS_TABLE = (HashTable *) malloc(sizeof(HashTable));
+       GLOBAL_AUTO_GLOBALS_TABLE = (HashTable *) malloc(sizeof(HashTable));
+       GLOBAL_CONSTANTS_TABLE = (HashTable *) malloc(sizeof(HashTable));
 
-       zend_hash_init_ex(global_function_table, 100, NULL, ZEND_FUNCTION_DTOR, 1, 0);
-       zend_hash_init_ex(global_class_table, 10, NULL, ZEND_CLASS_DTOR, 1, 0);
-       zend_hash_init_ex(global_auto_globals_table, 8, NULL, (dtor_func_t) zend_auto_global_dtor, 1, 0);
-       zend_hash_init_ex(global_constants_table, 20, NULL, ZEND_CONSTANT_DTOR, 1, 0);
+       zend_hash_init_ex(GLOBAL_FUNCTION_TABLE, 100, NULL, ZEND_FUNCTION_DTOR, 1, 0);
+       zend_hash_init_ex(GLOBAL_CLASS_TABLE, 10, NULL, ZEND_CLASS_DTOR, 1, 0);
+       zend_hash_init_ex(GLOBAL_AUTO_GLOBALS_TABLE, 8, NULL, (dtor_func_t) zend_auto_global_dtor, 1, 0);
+       zend_hash_init_ex(GLOBAL_CONSTANTS_TABLE, 20, NULL, ZEND_CONSTANT_DTOR, 1, 0);
 
        zend_hash_init_ex(&module_registry, 50, NULL, ZEND_MODULE_DTOR, 1, 0);
        zend_init_rsrc_list_dtors();
@@ -1235,22 +1046,16 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
        compiler_globals->function_table = (HashTable *) malloc(sizeof(HashTable));
        compiler_globals->class_table = (HashTable *) malloc(sizeof(HashTable));
 
-       *compiler_globals->function_table = *global_function_table;
-       *compiler_globals->class_table = *global_class_table;
-       compiler_globals->auto_globals = global_auto_globals_table;
+       *compiler_globals->function_table = *GLOBAL_FUNCTION_TABLE;
+       *compiler_globals->class_table = *GLOBAL_CLASS_TABLE;
+       compiler_globals->auto_globals = GLOBAL_AUTO_GLOBALS_TABLE;
 
        zend_hash_destroy(executor_globals->zend_constants);
-       *executor_globals->zend_constants = *global_constants_table;
+       *executor_globals->zend_constants = *GLOBAL_CONSTANTS_TABLE;
 #else
        unicode_globals_ctor(&unicode_globals TSRMLS_CC);
        scanner_globals_ctor(&ini_scanner_globals TSRMLS_CC);
        scanner_globals_ctor(&language_scanner_globals TSRMLS_CC);
-
-       CG(function_table) = global_function_table;
-       CG(class_table) = global_class_table;
-       CG(auto_globals) = global_auto_globals_table;
-       EG(zend_constants) = global_constants_table;
-
        zend_set_default_compile_time_values(TSRMLS_C);
        EG(user_error_handler) = NULL;
        EG(user_exception_handler) = NULL;
@@ -1261,7 +1066,6 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
 
 #ifndef ZTS
        zend_init_rsrc_plist(TSRMLS_C);
-       global_persistent_list = &EG(persistent_list);
 #endif
 
        if (start_builtin_functions) {
@@ -1290,44 +1094,34 @@ void zend_register_standard_ini_entries(TSRMLS_D)
  */
 void zend_post_startup(TSRMLS_D)
 {
-       UConverter *old_runtime_encoding_conv;
-  UErrorCode status = U_ZERO_ERROR;
-       zend_function tmp_func;
-       zend_class_entry *tmp_class;
-       zend_constant tmp_const;
 #ifdef ZTS
        zend_compiler_globals *compiler_globals = ts_resource(compiler_globals_id);
        zend_executor_globals *executor_globals = ts_resource(executor_globals_id);
 
-       *global_function_table = *compiler_globals->function_table;
-       *global_class_table = *compiler_globals->class_table;
-       *global_constants_table = *executor_globals->zend_constants;
+       *GLOBAL_FUNCTION_TABLE = *compiler_globals->function_table;
+       *GLOBAL_CLASS_TABLE = *compiler_globals->class_table;
+       *GLOBAL_CONSTANTS_TABLE = *executor_globals->zend_constants;
 #endif
 
        /* Make copies of HashTables with UNICODE */
 
-       old_runtime_encoding_conv = UG(runtime_encoding_conv);
-       UG(runtime_encoding_conv) = ucnv_open("ASCII", &status);
+       if (UG(unicode)) {
+               UConverter *old_runtime_encoding_conv;
+               UErrorCode status = U_ZERO_ERROR;
 
-       global_u_function_table = (HashTable *) malloc(sizeof(HashTable));
-       zend_u_hash_init_ex(global_u_function_table, global_function_table->nNumOfElements, NULL, ZEND_U_FUNCTION_DTOR, 1, 1, 0);
-       zend_hash_copy(global_u_function_table, global_function_table, (copy_ctor_func_t) function_to_unicode, &tmp_func, sizeof(zend_function));
+               old_runtime_encoding_conv = UG(runtime_encoding_conv);
+               UG(runtime_encoding_conv) = ucnv_open("ASCII", &status);
 
-       global_u_class_table = (HashTable *) malloc(sizeof(HashTable));
-       zend_u_hash_init_ex(global_u_class_table, global_class_table->nNumOfElements, NULL, ZEND_CLASS_DTOR, 1, 1, 0);
-       zend_hash_copy(global_u_class_table, global_class_table, (copy_ctor_func_t) class_to_unicode, &tmp_class, sizeof(zend_class_entry *));
-       fix_classes(global_u_class_table);
+               zend_hash_to_unicode(GLOBAL_FUNCTION_TABLE, (apply_func_t)function_to_unicode TSRMLS_CC);
+               GLOBAL_FUNCTION_TABLE->pDestructor = ZEND_U_FUNCTION_DTOR;
+               zend_hash_to_unicode(GLOBAL_CLASS_TABLE, (apply_func_t)class_to_unicode TSRMLS_CC);
+               zend_hash_to_unicode(GLOBAL_AUTO_GLOBALS_TABLE, NULL TSRMLS_CC);
+               zend_hash_to_unicode(GLOBAL_CONSTANTS_TABLE, (apply_func_t)const_to_unicode TSRMLS_CC);
+               GLOBAL_CONSTANTS_TABLE->pDestructor = ZEND_U_CONSTANT_DTOR;
 
-       global_u_auto_globals_table = (HashTable *) malloc(sizeof(HashTable));
-       zend_u_hash_init_ex(global_u_auto_globals_table, global_auto_globals_table->nNumOfElements, NULL, NULL, 1, 1, 0);
-       zend_hash_copy(global_u_auto_globals_table, global_auto_globals_table, NULL, NULL, sizeof(zend_auto_global));
-
-       global_u_constants_table = (HashTable *) malloc(sizeof(HashTable));
-       zend_u_hash_init_ex(global_u_constants_table, global_constants_table->nNumOfElements, NULL, ZEND_U_CONSTANT_DTOR, 1, 1, 0);
-       zend_hash_copy(global_u_constants_table, global_constants_table, (copy_ctor_func_t) const_to_unicode, &tmp_const, sizeof(zend_constant));
-
-  ucnv_close(UG(runtime_encoding_conv));
-       UG(runtime_encoding_conv) = old_runtime_encoding_conv;
+               ucnv_close(UG(runtime_encoding_conv));
+               UG(runtime_encoding_conv) = old_runtime_encoding_conv;
+       }
 
 #ifdef ZTS
        zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC);
@@ -1347,54 +1141,29 @@ void zend_shutdown(TSRMLS_D)
 #ifdef ZEND_WIN32
        zend_shutdown_timeout_thread();
 #endif
-       if (global_persistent_list) {
-               zend_destroy_rsrc_list(global_persistent_list TSRMLS_CC);
-       }
+       zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC);
        zend_hash_graceful_reverse_destroy(&module_registry);
 
-       zend_hash_destroy(global_function_table);
-       zend_hash_destroy(global_class_table);
-       if (global_u_function_table) {
-               zend_hash_destroy(global_u_function_table);
-       }
-       if (global_u_class_table) {
-               zend_hash_destroy(global_u_class_table);
-       }
+       zend_hash_destroy(GLOBAL_FUNCTION_TABLE);
+       zend_hash_destroy(GLOBAL_CLASS_TABLE);
 
-       zend_hash_destroy(global_auto_globals_table);
-       free(global_auto_globals_table);
-       if (global_u_auto_globals_table) {
-               zend_hash_destroy(global_u_auto_globals_table);
-               free(global_u_auto_globals_table);
-       }
+       zend_hash_destroy(GLOBAL_AUTO_GLOBALS_TABLE);
+       free(GLOBAL_AUTO_GLOBALS_TABLE);
 
        zend_shutdown_extensions(TSRMLS_C);
        free(zend_version_info);
 
-       zend_hash_destroy(global_constants_table);
-       free(global_constants_table);
-       if (global_u_constants_table) {
-               zend_hash_destroy(global_u_constants_table);
-               free(global_u_constants_table);
-       }
-       
-       free(global_function_table);
-       free(global_class_table);
-       if (global_u_function_table) {
-               free(global_u_function_table);
-       }
-       if (global_u_class_table) {
-               free(global_u_class_table);
-       }
+       free(GLOBAL_FUNCTION_TABLE);
+       free(GLOBAL_CLASS_TABLE);
+
+       zend_hash_destroy(GLOBAL_CONSTANTS_TABLE);
+       free(GLOBAL_CONSTANTS_TABLE);
+
 #ifdef ZTS
-       global_function_table = NULL;
-       global_u_function_table = NULL;
-       global_class_table = NULL;
-       global_u_class_table = NULL;
-       global_auto_globals_table = NULL;
-       global_u_auto_globals_table = NULL;
-       global_constants_table = NULL;
-       global_u_constants_table = NULL;
+       GLOBAL_FUNCTION_TABLE = NULL;
+       GLOBAL_CLASS_TABLE = NULL;
+       GLOBAL_AUTO_GLOBALS_TABLE = NULL;
+       GLOBAL_CONSTANTS_TABLE = NULL;
 #else
        unicode_globals_dtor(&unicode_globals TSRMLS_CC);
 #endif
@@ -1489,19 +1258,7 @@ static void shutdown_unicode_request_globals(TSRMLS_D)
 
 void zend_activate(TSRMLS_D)
 {
-#ifdef ZTS
-       CG(function_table) = UG(unicode)?CG(global_u_function_table):CG(global_function_table);
-       CG(class_table) = UG(unicode)?CG(global_u_class_table):CG(global_class_table);
-       CG(auto_globals) = UG(unicode)?CG(global_u_auto_globals_table):CG(global_auto_globals_table);
-       EG(zend_constants) = UG(unicode)?EG(global_u_constants_table):EG(global_constants_table);
-#else
-       CG(function_table) = UG(unicode)?global_u_function_table:global_function_table;
-       CG(class_table) = UG(unicode)?global_u_class_table:global_class_table;
-       CG(auto_globals) = UG(unicode)?global_u_auto_globals_table:global_auto_globals_table;
-       EG(zend_constants) = UG(unicode)?global_u_constants_table:global_constants_table;
-#endif
        init_unicode_request_globals(TSRMLS_C);
-
        init_unicode_strings();
        init_compiler(TSRMLS_C);
        init_executor(TSRMLS_C);
@@ -1730,7 +1487,7 @@ ZEND_API void zend_error(int type, const char *format, ...)
 
                        if (!EG(user_error_handler)) {
                                EG(user_error_handler) = orig_user_error_handler;
-                       } 
+                       }
                        else {
                                zval_ptr_dtor(&orig_user_error_handler);
                        }
index 99a0ba112ab287e0d1611ab16f25241d536c94b6..81f07093632683a2ba84e6471a3d7ca8b1049e33 100644 (file)
@@ -373,8 +373,6 @@ struct _zend_class_entry {
        char *doc_comment;
        zend_uint doc_comment_len;
 
-       zend_class_entry *u_twin;
-       
        struct _zend_module_entry *module;
 };
 
@@ -541,7 +539,7 @@ ZEND_API void zend_error(int type, const char *format, ...);
 void zenderror(char *error);
 
 /* The following #define is used for code duality in PHP for Engine 1 & 2 */
-#define ZEND_STANDARD_CLASS_DEF_PTR U_CLASS_ENTRY(zend_standard_class_def)
+#define ZEND_STANDARD_CLASS_DEF_PTR zend_standard_class_def
 extern ZEND_API zend_class_entry *zend_standard_class_def;
 extern ZEND_API zend_utility_values zend_uv;
 extern ZEND_API zval zval_used_for_init;
index 07a8fdb0a27983cbd3fb2b5825c914c71200f289..6e87f5156983c097b0c182bd76d7164dce045170 100644 (file)
@@ -1164,7 +1164,7 @@ ZEND_API int _object_init_ex(zval *arg, zend_class_entry *class_type ZEND_FILE_L
 
 ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC TSRMLS_DC)
 {
-       return _object_init_ex(arg, U_CLASS_ENTRY(zend_standard_class_def) ZEND_FILE_LINE_RELAY_CC TSRMLS_CC);
+       return _object_init_ex(arg, zend_standard_class_def ZEND_FILE_LINE_RELAY_CC TSRMLS_CC);
 }
 
 
index 8e6572c0fe4349f821ff2a76eca14510ba329773..035b4238e676548f1fa42f40cfa483193ab125f6 100644 (file)
@@ -114,8 +114,6 @@ typedef struct _zend_function_entry {
 
 #endif
 
-#define U_CLASS_ENTRY(ce) ((UG(unicode)&&ce)?ce->u_twin:ce)
-
 #define INIT_CLASS_ENTRY(class_container, class_name, functions) INIT_OVERLOADED_CLASS_ENTRY(class_container, class_name, functions, NULL, NULL, NULL)
 
 #define INIT_OVERLOADED_CLASS_ENTRY_EX(class_container, class_name, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \
@@ -145,7 +143,6 @@ typedef struct _zend_function_entry {
                class_container.interfaces = NULL;                                              \
                class_container.get_iterator = NULL;                                    \
                class_container.iterator_funcs.funcs = NULL;                    \
-               class_container.u_twin = NULL;                                                  \
                class_container.module = NULL;                                                  \
        }
 
index 3178cf60d4fd04e7b1f163f856f590d5f8757e48..3bbc5a46dddbca55a59e87597dfd794df2570f32 100644 (file)
@@ -179,7 +179,6 @@ struct _zend_op_array {
        zend_arg_info *arg_info;
        zend_bool pass_rest_by_reference;
        unsigned char return_reference;
-       union _zend_function *u_twin;
        /* END of common elements */
 
        zend_uint *refcount;
@@ -234,7 +233,6 @@ typedef struct _zend_internal_function {
        zend_arg_info *arg_info;
        zend_bool pass_rest_by_reference;
        unsigned char return_reference;
-       union _zend_function *u_twin;
        /* END of common elements */
 
        void (*handler)(INTERNAL_FUNCTION_PARAMETERS);
@@ -257,7 +255,6 @@ typedef union _zend_function {
                zend_arg_info *arg_info;
                zend_bool pass_rest_by_reference;
                unsigned char return_reference;
-               union _zend_function *u_twin;
        } common;
        
        zend_op_array op_array;
index 342988740b96817434e5ed1ab09bc82e521da8bf..eab7f65881e2b1aa0e1d4f32762a2b1e391b6c96 100644 (file)
@@ -93,9 +93,9 @@ static zend_object_value zend_default_exception_new_ex(zend_class_entry *class_t
        trace->refcount = 0;
        zend_fetch_debug_backtrace(trace, skip_top_traces, 0 TSRMLS_CC);
 
-       zend_update_property_rt_string(U_CLASS_ENTRY(default_exception_ce), &obj, "file", sizeof("file")-1, zend_get_executed_filename(TSRMLS_C) TSRMLS_CC);
-       zend_update_property_long(U_CLASS_ENTRY(default_exception_ce), &obj, "line", sizeof("line")-1, zend_get_executed_lineno(TSRMLS_C) TSRMLS_CC);
-       zend_update_property(U_CLASS_ENTRY(default_exception_ce), &obj, "trace", sizeof("trace")-1, trace TSRMLS_CC);
+       zend_update_property_rt_string(default_exception_ce, &obj, "file", sizeof("file")-1, zend_get_executed_filename(TSRMLS_C) TSRMLS_CC);
+       zend_update_property_long(default_exception_ce, &obj, "line", sizeof("line")-1, zend_get_executed_lineno(TSRMLS_C) TSRMLS_CC);
+       zend_update_property(default_exception_ce, &obj, "trace", sizeof("trace")-1, trace TSRMLS_CC);
 
        return obj.value.obj;
 }
@@ -139,22 +139,22 @@ ZEND_METHOD(exception, __construct)
 
        if (message) {
                if (message_type == IS_UNICODE) {
-                       zend_update_property_unicodel(U_CLASS_ENTRY(default_exception_ce), object, "message", sizeof("message")-1, message, message_len TSRMLS_CC);
+                       zend_update_property_unicodel(default_exception_ce, object, "message", sizeof("message")-1, message, message_len TSRMLS_CC);
                } else if (UG(unicode)) {
            UErrorCode status = U_ZERO_ERROR;
                        UChar *u_str;
                        int32_t u_len;
                        
                        zend_convert_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, message, message_len, &status);
-                       zend_update_property_unicodel(U_CLASS_ENTRY(default_exception_ce), object, "message", sizeof("message")-1, u_str, u_len TSRMLS_CC);
+                       zend_update_property_unicodel(default_exception_ce, object, "message", sizeof("message")-1, u_str, u_len TSRMLS_CC);
                        efree(u_str);
                } else {
-                       zend_update_property_stringl(U_CLASS_ENTRY(default_exception_ce), object, "message", sizeof("message")-1, message, message_len TSRMLS_CC);
+                       zend_update_property_stringl(default_exception_ce, object, "message", sizeof("message")-1, message, message_len TSRMLS_CC);
                }
        }
 
        if (code) {
-               zend_update_property_long(U_CLASS_ENTRY(default_exception_ce), object, "code", sizeof("code")-1, code TSRMLS_CC);
+               zend_update_property_long(default_exception_ce, object, "code", sizeof("code")-1, code TSRMLS_CC);
        }
 }
 /* }}} */
@@ -178,36 +178,36 @@ ZEND_METHOD(error_exception, __construct)
 
        if (message) {
                if (message_type == IS_UNICODE) {
-                       zend_update_property_unicodel(U_CLASS_ENTRY(default_exception_ce), object, "message", sizeof("message")-1, message, message_len TSRMLS_CC);
+                       zend_update_property_unicodel(default_exception_ce, object, "message", sizeof("message")-1, message, message_len TSRMLS_CC);
                } else if (UG(unicode)) {
            UErrorCode status = U_ZERO_ERROR;
                        UChar *u_str;
                        int32_t u_len;
                        
                        zend_convert_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, message, message_len, &status);
-                       zend_update_property_unicodel(U_CLASS_ENTRY(default_exception_ce), object, "message", sizeof("message")-1, u_str, u_len TSRMLS_CC);
+                       zend_update_property_unicodel(default_exception_ce, object, "message", sizeof("message")-1, u_str, u_len TSRMLS_CC);
                        efree(u_str);
                } else {
-                       zend_update_property_stringl(U_CLASS_ENTRY(default_exception_ce), object, "message", sizeof("message")-1, message, message_len TSRMLS_CC);
+                       zend_update_property_stringl(default_exception_ce, object, "message", sizeof("message")-1, message, message_len TSRMLS_CC);
                }
        }
 
        if (code) {
-               zend_update_property_long(U_CLASS_ENTRY(default_exception_ce), object, "code", sizeof("code")-1, code TSRMLS_CC);
+               zend_update_property_long(default_exception_ce, object, "code", sizeof("code")-1, code TSRMLS_CC);
        }
 
-       zend_update_property_long(U_CLASS_ENTRY(default_exception_ce), object, "severity", sizeof("severity")-1, severity TSRMLS_CC);
+       zend_update_property_long(default_exception_ce, object, "severity", sizeof("severity")-1, severity TSRMLS_CC);
        
        if (argc >= 4) {
                if (file_type == IS_UNICODE) {
-                       zend_update_property_unicodel(U_CLASS_ENTRY(default_exception_ce), object, "file", sizeof("file")-1, filename, filename_len TSRMLS_CC);
+                       zend_update_property_unicodel(default_exception_ce, object, "file", sizeof("file")-1, filename, filename_len TSRMLS_CC);
                } else {        
-                       zend_update_property_stringl(U_CLASS_ENTRY(default_exception_ce), object, "file", sizeof("file")-1, filename, filename_len TSRMLS_CC);
+                       zend_update_property_stringl(default_exception_ce, object, "file", sizeof("file")-1, filename, filename_len TSRMLS_CC);
                }
                if (argc < 5) {
                        lineno = 0; /* invalidate lineno */
                }
-               zend_update_property_long(U_CLASS_ENTRY(default_exception_ce), object, "line", sizeof("line")-1, lineno TSRMLS_CC);
+               zend_update_property_long(default_exception_ce, object, "line", sizeof("line")-1, lineno TSRMLS_CC);
        }
 }
 /* }}} */
@@ -221,7 +221,7 @@ static void _default_exception_get_entry(zval *object, char *name, int name_len,
 {
        zval *value;
 
-       value = zend_read_property(U_CLASS_ENTRY(default_exception_ce), object, name, name_len, 0 TSRMLS_CC);
+       value = zend_read_property(default_exception_ce, object, name, name_len, 0 TSRMLS_CC);
 
        *return_value = *value;
        zval_copy_ctor(return_value);
@@ -524,7 +524,7 @@ ZEND_METHOD(exception, getTraceAsString)
        char *res = estrdup(""), **str = &res, *s_tmp;
        int res_len = 0, *len = &res_len, num = 0;
        
-       trace = zend_read_property(U_CLASS_ENTRY(default_exception_ce), getThis(), "trace", sizeof("trace")-1, 1 TSRMLS_CC);
+       trace = zend_read_property(default_exception_ce, getThis(), "trace", sizeof("trace")-1, 1 TSRMLS_CC);
        zend_hash_apply_with_arguments(Z_ARRVAL_P(trace), (apply_func_args_t)_build_trace_string, 3, str, len, &num);
 
        s_tmp = emalloc(1 + MAX_LENGTH_OF_LONG + 7 + 1);
@@ -596,7 +596,7 @@ ZEND_METHOD(exception, __toString)
 
        /* We store the result in the private property string so we can access
         * the result in uncaught exception handlers without memleaks. */
-       zend_update_property_string(U_CLASS_ENTRY(default_exception_ce), getThis(), "string", sizeof("string")-1, str TSRMLS_CC);
+       zend_update_property_string(default_exception_ce, getThis(), "string", sizeof("string")-1, str TSRMLS_CC);
 
        if (trace) {
                zval_ptr_dtor(&trace);
@@ -678,12 +678,12 @@ void zend_register_default_exception(TSRMLS_D)
 
 ZEND_API zend_class_entry *zend_exception_get_default(TSRMLS_D)
 {
-       return U_CLASS_ENTRY(default_exception_ce);
+       return default_exception_ce;
 }
 
 ZEND_API zend_class_entry *zend_get_error_exception(TSRMLS_D)
 {
-       return U_CLASS_ENTRY(error_exception_ce);
+       return error_exception_ce;
 }
 
 
@@ -693,21 +693,21 @@ ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, char *messa
 
        MAKE_STD_ZVAL(ex);
        if (exception_ce) {
-               if (!instanceof_function(exception_ce, U_CLASS_ENTRY(default_exception_ce) TSRMLS_CC)) {
+               if (!instanceof_function(exception_ce, default_exception_ce TSRMLS_CC)) {
                        zend_error(E_NOTICE, "Exceptions must be derived from the Exception base class");
-                       exception_ce = U_CLASS_ENTRY(default_exception_ce);
+                       exception_ce = default_exception_ce;
                }
        } else {
-               exception_ce = U_CLASS_ENTRY(default_exception_ce);
+               exception_ce = default_exception_ce;
        }
        object_init_ex(ex, exception_ce);
        
 
        if (message) {
-               zend_update_property_rt_string(U_CLASS_ENTRY(default_exception_ce), ex, "message", sizeof("message")-1, message TSRMLS_CC);
+               zend_update_property_rt_string(default_exception_ce, ex, "message", sizeof("message")-1, message TSRMLS_CC);
        }
        if (code) {
-               zend_update_property_long(U_CLASS_ENTRY(default_exception_ce), ex, "code", sizeof("code")-1, code TSRMLS_CC);
+               zend_update_property_long(default_exception_ce, ex, "code", sizeof("code")-1, code TSRMLS_CC);
        }
 
        zend_throw_exception_internal(ex TSRMLS_CC);
@@ -733,7 +733,7 @@ ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long cod
 ZEND_API zval * zend_throw_error_exception(zend_class_entry *exception_ce, char *message, long code, int severity TSRMLS_DC)
 {
        zval *ex = zend_throw_exception(exception_ce, message, code TSRMLS_CC);
-       zend_update_property_long(U_CLASS_ENTRY(default_exception_ce), ex, "severity", sizeof("severity")-1, severity TSRMLS_CC);
+       zend_update_property_long(default_exception_ce, ex, "severity", sizeof("severity")-1, severity TSRMLS_CC);
        return ex;
 }
 
@@ -750,7 +750,7 @@ static void zend_error_va(int type, const char *file, uint lineno, const char *f
 ZEND_API void zend_exception_error(zval *exception TSRMLS_DC)
 {
        zend_class_entry *ce_exception = Z_OBJCE_P(exception);
-       if (instanceof_function(ce_exception, U_CLASS_ENTRY(default_exception_ce) TSRMLS_CC)) {
+       if (instanceof_function(ce_exception, default_exception_ce TSRMLS_CC)) {
                zval *str, *file, *line;
 
                EG(exception) = NULL;
@@ -760,16 +760,16 @@ ZEND_API void zend_exception_error(zval *exception TSRMLS_DC)
                        if (Z_TYPE_P(str) != IS_STRING) {
                                zend_error(E_WARNING, "%v::__toString() must return a string", ce_exception->name);
                        } else {
-                               zend_update_property_string(U_CLASS_ENTRY(default_exception_ce), exception, "string", sizeof("string")-1, EG(exception) ? ce_exception->name : Z_STRVAL_P(str) TSRMLS_CC);
+                               zend_update_property_string(default_exception_ce, exception, "string", sizeof("string")-1, EG(exception) ? ce_exception->name : Z_STRVAL_P(str) TSRMLS_CC);
                        }
                }
                zval_ptr_dtor(&str);
        
                if (EG(exception)) {
                        /* do the best we can to inform about the inner exception */
-                       if (instanceof_function(ce_exception, U_CLASS_ENTRY(default_exception_ce) TSRMLS_CC)) {
-                               file = zend_read_property(U_CLASS_ENTRY(default_exception_ce), EG(exception), "file", sizeof("file")-1, 1 TSRMLS_CC);
-                               line = zend_read_property(U_CLASS_ENTRY(default_exception_ce), EG(exception), "line", sizeof("line")-1, 1 TSRMLS_CC);
+                       if (instanceof_function(ce_exception, default_exception_ce TSRMLS_CC)) {
+                               file = zend_read_property(default_exception_ce, EG(exception), "file", sizeof("file")-1, 1 TSRMLS_CC);
+                               line = zend_read_property(default_exception_ce, EG(exception), "line", sizeof("line")-1, 1 TSRMLS_CC);
                        } else {
                                file = NULL;
                                line = NULL;
@@ -777,9 +777,9 @@ ZEND_API void zend_exception_error(zval *exception TSRMLS_DC)
                        zend_error_va(E_WARNING, file ? Z_STRVAL_P(file) : NULL, line ? Z_LVAL_P(line) : 0, "Uncaught %v in exception handling during call to %v::__tostring()", Z_OBJCE_P(EG(exception))->name, ce_exception->name);
                }
 
-               str = zend_read_property(U_CLASS_ENTRY(default_exception_ce), exception, "string", sizeof("string")-1, 1 TSRMLS_CC);
-               file = zend_read_property(U_CLASS_ENTRY(default_exception_ce), exception, "file", sizeof("file")-1, 1 TSRMLS_CC);
-               line = zend_read_property(U_CLASS_ENTRY(default_exception_ce), exception, "line", sizeof("line")-1, 1 TSRMLS_CC);
+               str = zend_read_property(default_exception_ce, exception, "string", sizeof("string")-1, 1 TSRMLS_CC);
+               file = zend_read_property(default_exception_ce, exception, "file", sizeof("file")-1, 1 TSRMLS_CC);
+               line = zend_read_property(default_exception_ce, exception, "line", sizeof("line")-1, 1 TSRMLS_CC);
 
                if (Z_TYPE_P(file) == IS_UNICODE) {
                        zval copy;
@@ -806,7 +806,7 @@ ZEND_API void zend_throw_exception_object(zval *exception TSRMLS_DC)
 
        exception_ce = Z_OBJCE_P(exception);
 
-       if (!exception_ce || !instanceof_function(exception_ce, U_CLASS_ENTRY(default_exception_ce) TSRMLS_CC)) {
+       if (!exception_ce || !instanceof_function(exception_ce, default_exception_ce TSRMLS_CC)) {
                zend_error(E_ERROR, "Exceptions must be valid objects derived from the Exception base class");
        }
        zend_throw_exception_internal(exception TSRMLS_CC);
index 5aa82c41fda0210d357f39993cd1d6a02324272c..6af32473b1cca3d39bb6528e06c823c978c727bb 100644 (file)
@@ -137,13 +137,6 @@ struct _zend_compiler_globals {
        char *script_encoding;
 
 #ifdef ZTS
-       HashTable *global_function_table;
-       HashTable *global_class_table;
-       HashTable *global_auto_globals_table;
-       HashTable *global_u_function_table;
-       HashTable *global_u_class_table;
-       HashTable *global_u_auto_globals_table;
-
        HashTable **static_members;
        int last_static_member;
 #endif
@@ -236,11 +229,6 @@ struct _zend_executor_globals {
 
        zend_property_info std_property_info;
 
-#ifdef ZTS
-       HashTable *global_constants_table;
-       HashTable *global_u_constants_table;
-#endif
-
        void *reserved[ZEND_MAX_RESERVED_RESOURCES];
 };
 
index b8edfd43aceb14bf8168a342f2ec6ee7100e0fad..1423557dc68e37135b93f896b307370fd93819e7 100644 (file)
 
 #define UNICODE_KEY(ht, type, arKey, nKeyLength, tmp) \
        if (ht->unicode && type == IS_STRING) { \
-    UErrorCode status = U_ZERO_ERROR; \
+               UErrorCode status = U_ZERO_ERROR; \
                UChar *u = NULL; \
                int32_t u_len; \
                TSRMLS_FETCH(); \
                zend_convert_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u, &u_len, (char*)arKey, nKeyLength-1, &status); \
-    if (U_FAILURE(status)) { \
+               if (U_FAILURE(status)) { \
                        /* UTODO: */ \
-       } \
-       type = IS_UNICODE; \
-       tmp = arKey = u; \
+               } \
+               type = IS_UNICODE; \
+               tmp = arKey = u; \
        }
 
 
@@ -1781,6 +1781,57 @@ void zend_hash_display(HashTable *ht)
                p = p->pListLast;
        }
 }
+
+ZEND_API void zend_hash_to_unicode(HashTable *ht, apply_func_t apply_func TSRMLS_DC)
+{
+       Bucket **p;
+       uint nIndex;
+
+       IS_CONSISTENT(ht);
+       if (ht->unicode) {
+               return;
+       }
+
+       ht->unicode = 1;
+       memset(ht->arBuckets, 0, ht->nTableSize * sizeof(Bucket *));
+       p = &ht->pListHead;
+       while ((*p) != NULL) {
+               if ((*p)->key.type == IS_STRING) {
+                       UErrorCode status = U_ZERO_ERROR;
+                       UChar *u = NULL;
+                       int32_t u_len;
+                       Bucket *q;
+
+                       zend_convert_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u, &u_len, (char*)(*p)->key.u.string, (*p)->nKeyLength-1, &status);
+
+                       q = (Bucket *) pemalloc(sizeof(Bucket)-sizeof(q->key.u)+((u_len+1)*2), ht->persistent);
+                       memcpy(q, *p, sizeof(Bucket)-sizeof(q->key.u));
+                       memcpy(q->key.u.unicode, u, (u_len+1)*2);
+                       q->key.type = IS_UNICODE;
+                       q->nKeyLength = u_len+1;
+                       q->h = zend_u_inline_hash_func(IS_UNICODE, (void*)q->key.u.unicode, q->nKeyLength);
+                       if ((*p)->pData == &(*p)->pDataPtr) {
+                               q->pData = &q->pDataPtr;
+                       }
+                       efree(u);
+                       pefree(*p, ht->persistent);
+                       *p = q;
+                       if (q->pListNext) {
+                               q->pListNext->pListLast = q;
+                       } else {
+                               ht->pListTail = q;
+                       }
+               }
+               nIndex = (*p)->h & ht->nTableMask;
+               CONNECT_TO_BUCKET_DLLIST(*p, ht->arBuckets[nIndex]);
+               ht->arBuckets[nIndex] = *p;
+               if (apply_func) {
+                       apply_func((*p)->pData TSRMLS_CC);
+               }
+               p = &(*p)->pListNext;
+       }
+}
+
 #endif
 
 /*
index 532620c1e3afc42caa75a6637c887ef67267fe8d..19a8f2c03f415e84a54b59195d299619ec1164d4 100644 (file)
@@ -175,6 +175,7 @@ ZEND_API void zend_hash_apply_with_arguments(HashTable *ht, apply_func_args_t ap
  */
 ZEND_API void zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC);
 
+ZEND_API void zend_hash_to_unicode(HashTable *ht, apply_func_t apply_func TSRMLS_DC);
 
 /* Deletes */
 ZEND_API int zend_hash_del_key_or_index(HashTable *ht, char *arKey, uint nKeyLength, ulong h, int flag);
index ca424f5ac4890f67beff84b11e31f5b452358411..d0f1321b94512c66ab421b4c5c3d903175ac4e8f 100644 (file)
@@ -193,6 +193,7 @@ END_EXTERN_C()
 typedef void (*zend_ini_parser_cb_t)(zval *arg1, zval *arg2, int callback_type, void *arg);
 BEGIN_EXTERN_C()
 ZEND_API int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg);
+ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg);
 END_EXTERN_C()
 
 #define ZEND_INI_PARSER_ENTRY  1
index 8c1976ac887dc405721d68426840d3fa91d79aff..8d9098f9ed9b936820aba88cd46b96612de46654 100644 (file)
@@ -157,10 +157,14 @@ static void ini_error(char *str)
        TSRMLS_FETCH();
 
        currently_parsed_filename = zend_ini_scanner_get_filename(TSRMLS_C);
-       error_buf_len = 128+strlen(currently_parsed_filename); /* should be more than enough */
-       error_buf = (char *) emalloc(error_buf_len);
+       if (currently_parsed_filename) {
+               error_buf_len = 128+strlen(currently_parsed_filename); /* should be more than enough */
+               error_buf = (char *) emalloc(error_buf_len);
 
-       sprintf(error_buf, "Error parsing %s on line %d\n", currently_parsed_filename, zend_ini_scanner_get_lineno(TSRMLS_C));
+               sprintf(error_buf, "Error parsing %s on line %d\n", currently_parsed_filename, zend_ini_scanner_get_lineno(TSRMLS_C));
+       } else {
+               error_buf = estrdup("Invalid configuration directive\n");
+       }
 
        if (CG(ini_parser_unbuffered_errors)) {
 #ifdef PHP_WIN32
@@ -202,6 +206,30 @@ ZEND_API int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_erro
 }
 
 
+ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg)
+{
+       int len;
+       zend_ini_parser_param ini_parser_param;
+       TSRMLS_FETCH();
+
+       ini_parser_param.ini_parser_cb = ini_parser_cb;
+       ini_parser_param.arg = arg;
+
+       CG(ini_parser_param) = &ini_parser_param;
+       if (zend_ini_prepare_string_for_scanning(str TSRMLS_CC)==FAILURE) {
+               return FAILURE;
+       }
+
+       CG(ini_parser_unbuffered_errors) = unbuffered_errors;
+
+       if (ini_parse(TSRMLS_C)) {
+               return SUCCESS;
+       } else {
+               return FAILURE;
+       }
+}
+
+
 %}
 
 %pure_parser
index e5cc41d583dc0c9d0c7109a5911294451f089598..95499f07225c38add5f0599bde8525400caa152f 100644 (file)
@@ -26,6 +26,7 @@ BEGIN_EXTERN_C()
 int zend_ini_scanner_get_lineno(TSRMLS_D);
 char *zend_ini_scanner_get_filename(TSRMLS_D);
 int zend_ini_open_file_for_scanning(zend_file_handle *fh TSRMLS_DC);
+int zend_ini_prepare_string_for_scanning(char *str TSRMLS_DC);
 void zend_ini_close_file(zend_file_handle *fh TSRMLS_DC);
 int ini_lex(zval *ini_lval TSRMLS_DC);
 END_EXTERN_C()
index 5f21e86a2ddb30dc46f615788174599b741a1f29..c42051938fd0dd07ae4a3b7ff309b3547f87dec0 100644 (file)
@@ -87,6 +87,16 @@ int zend_ini_open_file_for_scanning(zend_file_handle *fh TSRMLS_DC)
 }
 
 
+int zend_ini_prepare_string_for_scanning(char *str TSRMLS_DC)
+{
+       int len = strlen(str);
+
+       yyin = NULL;
+       yy_scan_buffer(str, len + 2 TSRMLS_CC);
+       ini_filename = NULL;
+       return SUCCESS;
+}
+
 void zend_ini_close_file(zend_file_handle *fh TSRMLS_DC)
 {
        zend_stream_close(fh);
index 66f43f9fc05c160d315401c100a85139b5ef1c9b..07b9d450c224a4d2a1ee735c6fc1a4baabdd5a18 100755 (executable)
@@ -325,11 +325,11 @@ static int zend_implement_traversable(zend_class_entry *interface, zend_class_en
                return SUCCESS;
        }
        for (i = 0; i < class_type->num_interfaces; i++) {
-               if (class_type->interfaces[i] == U_CLASS_ENTRY(zend_ce_aggregate) || class_type->interfaces[i] == U_CLASS_ENTRY(zend_ce_iterator)) {
+               if (class_type->interfaces[i] == zend_ce_aggregate || class_type->interfaces[i] == zend_ce_iterator) {
                        return SUCCESS;
                }
        }
-       zend_error(E_CORE_ERROR, "Class %v must implement interface %s as part of either %s or %s",
+       zend_error(E_CORE_ERROR, "Class %v must implement interface %v as part of either %v or %v",
                class_type->name,
                zend_ce_traversable->name,
                zend_ce_iterator->name,
@@ -351,10 +351,10 @@ static int zend_implement_aggregate(zend_class_entry *interface, zend_class_entr
                        /* c-level get_iterator cannot be changed (exception being only Traversable is implmented) */
                        if (class_type->num_interfaces) {
                                for (i = 0; i < class_type->num_interfaces; i++) {
-                                       if (class_type->interfaces[i] == U_CLASS_ENTRY(zend_ce_iterator)) {
+                                       if (class_type->interfaces[i] == zend_ce_iterator) {
                                                return FAILURE;
                                        }
-                                       if (class_type->interfaces[i] == U_CLASS_ENTRY(zend_ce_traversable)) {
+                                       if (class_type->interfaces[i] == zend_ce_traversable) {
                                                t = i;
                                        }
                                }
index 710484fb3487babe4058558bc326561e0fb58df6..4804f1dad8675ca48bd54ce6484c5669af933b2e 100644 (file)
@@ -436,7 +436,7 @@ zval *zend_std_read_dimension(zval *object, zval *offset, int type TSRMLS_DC)
        zend_class_entry *ce = Z_OBJCE_P(object);
        zval *retval;
        
-       if (instanceof_function_ex(ce, U_CLASS_ENTRY(zend_ce_arrayaccess), 1 TSRMLS_CC)) {
+       if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) {
                if(offset == NULL) {
                        /* [] construct */
                        ALLOC_INIT_ZVAL(offset);
@@ -469,7 +469,7 @@ static void zend_std_write_dimension(zval *object, zval *offset, zval *value TSR
 {
        zend_class_entry *ce = Z_OBJCE_P(object);
 
-       if (instanceof_function_ex(ce, U_CLASS_ENTRY(zend_ce_arrayaccess), 1 TSRMLS_CC)) {
+       if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) {
                if (!offset) {
                        ALLOC_INIT_ZVAL(offset);
                } else {
@@ -489,7 +489,7 @@ static int zend_std_has_dimension(zval *object, zval *offset, int check_empty TS
        zval *retval;
        int result;
        
-       if (instanceof_function_ex(ce, U_CLASS_ENTRY(zend_ce_arrayaccess), 1 TSRMLS_CC)) {
+       if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) {
                SEPARATE_ARG_IF_REF(offset);
                zend_call_method_with_1_params(&object, ce, NULL, "offsetexists", &retval, offset);
                if (retval) {
@@ -603,7 +603,7 @@ static void zend_std_unset_dimension(zval *object, zval *offset TSRMLS_DC)
 {
        zend_class_entry *ce = Z_OBJCE_P(object);
        
-       if (instanceof_function_ex(ce, U_CLASS_ENTRY(zend_ce_arrayaccess), 1 TSRMLS_CC)) {
+       if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) {
                SEPARATE_ARG_IF_REF(offset);
                zend_call_method_with_1_params(&object, ce, NULL, "offsetunset", NULL, offset);
                zval_ptr_dtor(&offset);
index 884d0da224b6048e015ab497f2bc7b01c12aa4dd..a0ece2f3e361e66f5e7a06b68ad9eb899cdf97c3 100644 (file)
@@ -838,7 +838,7 @@ ZEND_API void convert_to_object(zval *op)
        switch (op->type) {
                case IS_ARRAY:
                        {
-                               object_and_properties_init(op, U_CLASS_ENTRY(zend_standard_class_def), op->value.ht);
+                               object_and_properties_init(op, zend_standard_class_def, op->value.ht);
                                return;
                                break;
                        }
index edbc3d55ba26578b23795a385b978aedbeb0ab91..250b0ed87a7d850d214489ae019261c37ef42e70 100644 (file)
@@ -36,7 +36,7 @@ void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC)
                message = php_win_err(code);
                free_msg = 1;
        }
-       zend_throw_exception(U_CLASS_ENTRY(php_com_exception_class_entry), message, (long)code TSRMLS_CC);
+       zend_throw_exception(php_com_exception_class_entry, message, (long)code TSRMLS_CC);
        if (free_msg) {
                LocalFree(message);
        }
index a5874fc35ad0b5ca11a2aaa7744d20433aa78797..311496282b19df15aa0408132af095cd6bbf390e 100644 (file)
@@ -54,8 +54,8 @@ PHP_METHOD(domattr, __construct)
        char *name, *value = NULL;
        int name_len, value_len, name_valid;
 
-       php_set_error_handling(EH_THROW, U_CLASS_ENTRY(dom_domexception_class_entry) TSRMLS_CC);
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, U_CLASS_ENTRY(dom_attr_class_entry), &name, &name_len, &value, &value_len) == FAILURE) {
+       php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_attr_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
                php_std_error_handling();
                return;
        }
@@ -263,7 +263,7 @@ PHP_FUNCTION(dom_attr_is_id)
        dom_object *intern;
        xmlAttrPtr attrp;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, U_CLASS_ENTRY(dom_attr_class_entry)) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_attr_class_entry) == FAILURE) {
                return;
        }
 
index d0f34a16515e21eeb1a97f8e9270347d4e445276..7d997fd4e2be77d8ab023b3dc960c6c00635d751 100644 (file)
@@ -50,8 +50,8 @@ PHP_METHOD(domcdatasection, __construct)
        char *value = NULL;
        int value_len;
 
-       php_set_error_handling(EH_THROW, U_CLASS_ENTRY(dom_domexception_class_entry) TSRMLS_CC);
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_cdatasection_class_entry), &value, &value_len) == FAILURE) {
+       php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_cdatasection_class_entry, &value, &value_len) == FAILURE) {
                php_std_error_handling();
                return;
        }
index eb90421ffba802cbe278667b858bd03e89f07167..b45578e1e98c691a00f7311162812ecb4b3d4c32 100644 (file)
@@ -154,7 +154,7 @@ PHP_FUNCTION(dom_characterdata_substring_data)
        int         length;
        dom_object      *intern;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll", &id, U_CLASS_ENTRY(dom_characterdata_class_entry), &offset, &count) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll", &id, dom_characterdata_class_entry, &offset, &count) == FAILURE) {
                return;
        }
 
@@ -202,7 +202,7 @@ PHP_FUNCTION(dom_characterdata_append_data)
        char *arg;
        int arg_len;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_characterdata_class_entry), &arg, &arg_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_characterdata_class_entry, &arg, &arg_len) == FAILURE) {
                return;
        }
 
@@ -229,7 +229,7 @@ PHP_FUNCTION(dom_characterdata_insert_data)
        int         length, arg_len;
        dom_object      *intern;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ols", &id, U_CLASS_ENTRY(dom_characterdata_class_entry), &offset, &arg, &arg_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ols", &id, dom_characterdata_class_entry, &offset, &arg, &arg_len) == FAILURE) {
                return;
        }
 
@@ -277,7 +277,7 @@ PHP_FUNCTION(dom_characterdata_delete_data)
        int         length;
        dom_object      *intern;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll", &id, U_CLASS_ENTRY(dom_characterdata_class_entry), &offset, &count) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll", &id, dom_characterdata_class_entry, &offset, &count) == FAILURE) {
                return;
        }
 
@@ -334,7 +334,7 @@ PHP_FUNCTION(dom_characterdata_replace_data)
        int         length, arg_len;
        dom_object      *intern;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Olls", &id, U_CLASS_ENTRY(dom_characterdata_class_entry), &offset, &count, &arg, &arg_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Olls", &id, dom_characterdata_class_entry, &offset, &count, &arg, &arg_len) == FAILURE) {
                return;
        }
 
index 1c0a3ec5b107e72f023d8bc5fd13e4bcb449f264..c4653d7419da6a510088841cd0477d5f829bba6d 100644 (file)
@@ -50,8 +50,8 @@ PHP_METHOD(domcomment, __construct)
        char *value = NULL;
        int value_len;
 
-       php_set_error_handling(EH_THROW, U_CLASS_ENTRY(dom_domexception_class_entry) TSRMLS_CC);
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|s", &id, U_CLASS_ENTRY(dom_comment_class_entry), &value, &value_len) == FAILURE) {
+       php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|s", &id, dom_comment_class_entry, &value, &value_len) == FAILURE) {
                php_std_error_handling();
                return;
        }
index 019122040468aa652a09c21d4fc2ef89304f65db..470b488343a737403cb57cb4495bba2ade2b5e30 100644 (file)
@@ -774,7 +774,7 @@ PHP_FUNCTION(dom_document_create_element)
        int ret, name_len, value_len;
        char *name, *value = NULL;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, U_CLASS_ENTRY(dom_document_class_entry), &name, &name_len, &value, &value_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_document_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
                return;
        }
 
@@ -807,7 +807,7 @@ PHP_FUNCTION(dom_document_create_document_fragment)
        dom_object *intern;
        int ret;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, U_CLASS_ENTRY(dom_document_class_entry)) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_document_class_entry) == FAILURE) {
                return;
        }
 
@@ -836,7 +836,7 @@ PHP_FUNCTION(dom_document_create_text_node)
        dom_object *intern;
        char *value;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_document_class_entry), &value, &value_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &value, &value_len) == FAILURE) {
                return;
        }
 
@@ -865,7 +865,7 @@ PHP_FUNCTION(dom_document_create_comment)
        dom_object *intern;
        char *value;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_document_class_entry), &value, &value_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &value, &value_len) == FAILURE) {
                return;
        }
 
@@ -894,7 +894,7 @@ PHP_FUNCTION(dom_document_create_cdatasection)
        dom_object *intern;
        char *value;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_document_class_entry), &value, &value_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &value, &value_len) == FAILURE) {
                return;
        }
 
@@ -923,7 +923,7 @@ PHP_FUNCTION(dom_document_create_processing_instruction)
        dom_object *intern;
        char *name, *value = NULL;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, U_CLASS_ENTRY(dom_document_class_entry), &name, &name_len, &value, &value_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_document_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
                return;
        }
 
@@ -959,7 +959,7 @@ PHP_FUNCTION(dom_document_create_attribute)
        dom_object *intern;
        char *name;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_document_class_entry), &name, &name_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &name, &name_len) == FAILURE) {
                return;
        }
 
@@ -994,7 +994,7 @@ PHP_FUNCTION(dom_document_create_entity_reference)
        int ret, name_len;
        char *name;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_document_class_entry), &name, &name_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &name, &name_len) == FAILURE) {
                return;
        }
 
@@ -1028,7 +1028,7 @@ PHP_FUNCTION(dom_document_get_elements_by_tag_name)
        char *name;
        xmlChar *local;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_document_class_entry), &name, &name_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &name, &name_len) == FAILURE) {
                return;
        }
 
@@ -1056,7 +1056,7 @@ PHP_FUNCTION(dom_document_import_node)
        int ret; 
        long recursive = 0;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO|l", &id, U_CLASS_ENTRY(dom_document_class_entry), &node, U_CLASS_ENTRY(dom_node_class_entry), &recursive) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO|l", &id, dom_document_class_entry, &node, dom_node_class_entry, &recursive) == FAILURE) {
                return;
        }
 
@@ -1101,7 +1101,7 @@ PHP_FUNCTION(dom_document_create_element_ns)
        int errorcode;
        dom_object *intern;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s|s", &id, U_CLASS_ENTRY(dom_document_class_entry), &uri, &uri_len, &name, &name_len, &value, &value_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s|s", &id, dom_document_class_entry, &uri, &uri_len, &name, &name_len, &value, &value_len) == FAILURE) {
                return;
        }
 
@@ -1165,7 +1165,7 @@ PHP_FUNCTION(dom_document_create_attribute_ns)
        dom_object *intern;
        int errorcode;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, U_CLASS_ENTRY(dom_document_class_entry), &uri, &uri_len, &name, &name_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_document_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
                return;
        }
 
@@ -1228,7 +1228,7 @@ PHP_FUNCTION(dom_document_get_elements_by_tag_name_ns)
        char *uri, *name;
        xmlChar *local, *nsuri;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, U_CLASS_ENTRY(dom_document_class_entry), &uri, &uri_len, &name, &name_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, dom_document_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
                return;
        }
 
@@ -1256,7 +1256,7 @@ PHP_FUNCTION(dom_document_get_element_by_id)
        dom_object *intern;
        char *idname;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_document_class_entry), &idname, &idname_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &idname, &idname_len) == FAILURE) {
                return;
        }
 
@@ -1295,7 +1295,7 @@ PHP_FUNCTION(dom_document_normalize_document)
        xmlDocPtr docp;
        dom_object *intern;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, U_CLASS_ENTRY(dom_document_class_entry)) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_document_class_entry) == FAILURE) {
                return;
        }
 
@@ -1326,8 +1326,8 @@ PHP_METHOD(domdocument, __construct)
        char *encoding, *version = NULL;
        int encoding_len = 0, version_len = 0, refcount;
 
-       php_set_error_handling(EH_THROW, U_CLASS_ENTRY(dom_domexception_class_entry) TSRMLS_CC);
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ss", &id, U_CLASS_ENTRY(dom_document_class_entry), &version, &version_len, &encoding, &encoding_len) == FAILURE) {
+       php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ss", &id, dom_document_class_entry, &version, &version_len, &encoding, &encoding_len) == FAILURE) {
                php_std_error_handling();
                return;
        }
@@ -1534,7 +1534,7 @@ static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) {
        long options = 0;
 
        id = getThis();
-       if (id != NULL && ! instanceof_function(Z_OBJCE_P(id), U_CLASS_ENTRY(dom_document_class_entry) TSRMLS_CC)) {
+       if (id != NULL && ! instanceof_function(Z_OBJCE_P(id), dom_document_class_entry TSRMLS_CC)) {
                id = NULL;
        }
 
@@ -1613,7 +1613,7 @@ PHP_FUNCTION(dom_document_save)
        char *file;
        long options = 0;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|l", &id, U_CLASS_ENTRY(dom_document_class_entry), &file, &file_len, &options) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|l", &id, dom_document_class_entry, &file, &file_len, &options) == FAILURE) {
                return;
        }
 
@@ -1659,7 +1659,7 @@ PHP_FUNCTION(dom_document_savexml)
        int size, format, saveempty;
        long options = 0;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|O!l", &id, U_CLASS_ENTRY(dom_document_class_entry), &nodep, U_CLASS_ENTRY(dom_node_class_entry), &options) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|O!l", &id, dom_document_class_entry, &nodep, dom_node_class_entry, &options) == FAILURE) {
                return;
        }
 
@@ -1758,7 +1758,7 @@ PHP_FUNCTION(dom_document_xinclude)
        int err;
        dom_object *intern;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", &id, U_CLASS_ENTRY(dom_document_class_entry), &flags) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", &id, dom_document_class_entry, &flags) == FAILURE) {
                return;
        }
 
@@ -1797,7 +1797,7 @@ PHP_FUNCTION(dom_document_validate)
        dom_object *intern;
        xmlValidCtxt *cvp;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, U_CLASS_ENTRY(dom_document_class_entry)) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_document_class_entry) == FAILURE) {
                return;
        }
 
@@ -1839,7 +1839,7 @@ _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type)
        int                     is_valid;
        char resolved_path[MAXPATHLEN + 1];
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_document_class_entry), &source, &source_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &source, &source_len) == FAILURE) {
                return;
        }
 
@@ -1929,7 +1929,7 @@ _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int type)
        int                     is_valid;
        char resolved_path[MAXPATHLEN + 1];
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_document_class_entry), &source, &source_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &source, &source_len) == FAILURE) {
                return;
        }
 
@@ -2053,7 +2053,7 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode)
        if (!newdoc)
                RETURN_FALSE;
 
-       if (id != NULL && instanceof_function(Z_OBJCE_P(id), U_CLASS_ENTRY(dom_document_class_entry) TSRMLS_CC)) {
+       if (id != NULL && instanceof_function(Z_OBJCE_P(id), dom_document_class_entry TSRMLS_CC)) {
                intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
                if (intern != NULL) {
                        docp = (xmlDocPtr) dom_object_get_node(intern);
@@ -2110,7 +2110,7 @@ PHP_FUNCTION(dom_document_save_html_file)
        dom_doc_propsptr doc_props;
        char *file;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_document_class_entry), &file, &file_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &file, &file_len) == FAILURE) {
                return;
        }
 
@@ -2145,7 +2145,7 @@ PHP_FUNCTION(dom_document_save_html)
        xmlChar *mem;
        int size;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, U_CLASS_ENTRY(dom_document_class_entry)) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_document_class_entry) == FAILURE) {
                return;
        }
 
@@ -2176,7 +2176,7 @@ PHP_METHOD(domdocument, registerNodeClass)
        dom_object *intern;
        zend_uchar type1, type2;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss!", &id, U_CLASS_ENTRY(dom_document_class_entry), &baseclass, &baseclass_len, &extendedclass, &extendedclass_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss!", &id, dom_document_class_entry, &baseclass, &baseclass_len, &extendedclass, &extendedclass_len) == FAILURE) {
                return;
        }
 
@@ -2189,7 +2189,7 @@ PHP_METHOD(domdocument, registerNodeClass)
                basece = *pce;
        }
 
-       if (basece == NULL || ! instanceof_function(basece, U_CLASS_ENTRY(dom_node_class_entry) TSRMLS_CC)) {
+       if (basece == NULL || ! instanceof_function(basece, dom_node_class_entry TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s is not derived from DOMNode.", baseclass);
                return;
        }
index 142321f7bc4e042aa78381b1094624bce96fda0f..1afc644fc1079aa24c1862db18da779d8878e911 100644 (file)
@@ -49,7 +49,7 @@ PHP_METHOD(domdocumentfragment, __construct)
        xmlNodePtr nodep = NULL, oldnode = NULL;
        dom_object *intern;
 
-       php_set_error_handling(EH_THROW, U_CLASS_ENTRY(dom_domexception_class_entry) TSRMLS_CC);
+       php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
        if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_documentfragment_class_entry) == FAILURE) {
                php_std_error_handling();
                return;
index 865400d655b6bbf555f3b7d1ef737558e149b500..c9a7dd300cc77fd2d216f4156f872bc588e83684 100644 (file)
@@ -161,7 +161,7 @@ static int php_dom_iterator_current_key(zend_object_iterator *iter, char **str_k
 
        object = (zval *)iterator->intern.data;
 
-       if (instanceof_function(Z_OBJCE_P(object), U_CLASS_ENTRY(dom_nodelist_class_entry) TSRMLS_CC)) {
+       if (instanceof_function(Z_OBJCE_P(object), dom_nodelist_class_entry TSRMLS_CC)) {
                *int_key = iter->index - 1;
                return HASH_KEY_IS_LONG;
        } else {
index db16e67537a835c5a7e315d3a6a9b8379148193c..3f898513c4c82ba954386888cbfbcf18f51bc186 100644 (file)
@@ -45,7 +45,7 @@ zend_function_entry php_dom_domexception_class_functions[] = {
 void php_dom_throw_error_with_message(int error_code, char *error_message, int strict_error TSRMLS_DC)
 {
        if (strict_error == 1) {
-               zend_throw_exception(U_CLASS_ENTRY(dom_domexception_class_entry), error_message, error_code TSRMLS_CC);
+               zend_throw_exception(dom_domexception_class_entry, error_message, error_code TSRMLS_CC);
        } else {
                php_libxml_issue_error(E_WARNING, error_message TSRMLS_CC);
        }
index c9b3798db2a6bc0612bbdb098e4bb8968dfc14d0..aa371f81540672eaf7ab7fd00644d77d6a9e3763 100644 (file)
@@ -134,7 +134,7 @@ PHP_METHOD(domimplementation, createDocument)
        char *prefix = NULL, *localname = NULL;
        dom_object *doctobj;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ssO", &uri, &uri_len, &name, &name_len, &node, U_CLASS_ENTRY(dom_documenttype_class_entry)) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ssO", &uri, &uri_len, &name, &name_len, &node, dom_documenttype_class_entry) == FAILURE) {
                return;
        }
 
index c68b9fab0ce876353f8f3b6d2accdbea24e3d5df..08b3dcbe8b423f3e6cfbce02cc359863e0c43951 100644 (file)
@@ -71,8 +71,8 @@ PHP_METHOD(domelement, __construct)
        int name_len, value_len = 0, name_valid;
        xmlNsPtr nsptr = NULL;
 
-       php_set_error_handling(EH_THROW, U_CLASS_ENTRY(dom_domexception_class_entry) TSRMLS_CC);
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s!s", &id, U_CLASS_ENTRY(dom_element_class_entry), &name, &name_len, &value, &value_len, &uri, &uri_len) == FAILURE) {
+       php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s!s", &id, dom_element_class_entry, &name, &name_len, &value, &value_len, &uri, &uri_len) == FAILURE) {
                php_std_error_handling();
                return;
        }
@@ -202,7 +202,7 @@ PHP_FUNCTION(dom_element_get_attribute)
        dom_object *intern;
        int name_len;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_element_class_entry), &name, &name_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
                return;
        }
 
@@ -233,7 +233,7 @@ PHP_FUNCTION(dom_element_set_attribute)
        char *name, *value;
 
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, U_CLASS_ENTRY(dom_element_class_entry), &name, &name_len, &value, &value_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, dom_element_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
                return;
        }
 
@@ -278,7 +278,7 @@ PHP_FUNCTION(dom_element_remove_attribute)
        int name_len;
        char *name;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_element_class_entry), &name, &name_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
                return;
        }
 
@@ -322,7 +322,7 @@ PHP_FUNCTION(dom_element_get_attribute_node)
        dom_object *intern;
        char *name;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_element_class_entry), &name, &name_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
                return;
        }
 
@@ -350,7 +350,7 @@ PHP_FUNCTION(dom_element_set_attribute_node)
        dom_object *intern, *attrobj, *oldobj;
        int ret;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, U_CLASS_ENTRY(dom_element_class_entry), &node, U_CLASS_ENTRY(dom_attr_class_entry)) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_element_class_entry, &node, dom_attr_class_entry) == FAILURE) {
                return;
        }
 
@@ -413,7 +413,7 @@ PHP_FUNCTION(dom_element_remove_attribute_node)
        dom_object *intern, *attrobj;
        int ret;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, U_CLASS_ENTRY(dom_element_class_entry), &node, U_CLASS_ENTRY(dom_attr_class_entry)) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_element_class_entry, &node, dom_attr_class_entry) == FAILURE) {
                return;
        }
 
@@ -452,7 +452,7 @@ PHP_FUNCTION(dom_element_get_elements_by_tag_name)
        char *name;
        xmlChar *local;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_element_class_entry), &name, &name_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
                return;
        }
 
@@ -479,7 +479,7 @@ PHP_FUNCTION(dom_element_get_attribute_ns)
        int uri_len = 0, name_len = 0;
        char *uri, *name, *strattr;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, U_CLASS_ENTRY(dom_element_class_entry), &uri, &uri_len, &name, &name_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
                return;
        }
 
@@ -559,7 +559,7 @@ PHP_FUNCTION(dom_element_set_attribute_ns)
        dom_object *intern;
        int errorcode = 0, stricterror, is_xmlns = 0;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!ss", &id, U_CLASS_ENTRY(dom_element_class_entry), &uri, &uri_len, &name, &name_len, &value, &value_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!ss", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len, &value, &value_len) == FAILURE) {
                return;
        }
 
@@ -668,7 +668,7 @@ PHP_FUNCTION(dom_element_remove_attribute_ns)
        int name_len, uri_len;
        char *name, *uri;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, U_CLASS_ENTRY(dom_element_class_entry), &uri, &uri_len, &name, &name_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
                return;
        }
 
@@ -725,7 +725,7 @@ PHP_FUNCTION(dom_element_get_attribute_node_ns)
        int uri_len, name_len, ret;
        char *uri, *name;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, U_CLASS_ENTRY(dom_element_class_entry), &uri, &uri_len, &name, &name_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
                return;
        }
 
@@ -756,7 +756,7 @@ PHP_FUNCTION(dom_element_set_attribute_node_ns)
        dom_object *intern, *attrobj, *oldobj;
        int ret;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, U_CLASS_ENTRY(dom_element_class_entry), &node, U_CLASS_ENTRY(dom_attr_class_entry)) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_element_class_entry, &node, dom_attr_class_entry) == FAILURE) {
                return;
        }
 
@@ -827,7 +827,7 @@ PHP_FUNCTION(dom_element_get_elements_by_tag_name_ns)
        char *uri, *name;
        xmlChar *local, *nsuri;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, U_CLASS_ENTRY(dom_element_class_entry), &uri, &uri_len, &name, &name_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
                return;
        }
 
@@ -855,7 +855,7 @@ PHP_FUNCTION(dom_element_has_attribute)
        char *name, *value;
        int name_len;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_element_class_entry), &name, &name_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
                return;
        }
 
@@ -885,7 +885,7 @@ PHP_FUNCTION(dom_element_has_attribute_ns)
        int uri_len, name_len;
        char *uri, *name, *value;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, U_CLASS_ENTRY(dom_element_class_entry), &uri, &uri_len, &name, &name_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
                return;
        }
 
@@ -942,7 +942,7 @@ PHP_FUNCTION(dom_element_set_id_attribute)
        int name_len;
        zend_bool is_id;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Osb", &id, U_CLASS_ENTRY(dom_element_class_entry), &name, &name_len, &is_id) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Osb", &id, dom_element_class_entry, &name, &name_len, &is_id) == FAILURE) {
                return;
        }
 
@@ -979,7 +979,7 @@ PHP_FUNCTION(dom_element_set_id_attribute_ns)
        char *uri, *name;
        zend_bool is_id;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ossb", &id, U_CLASS_ENTRY(dom_element_class_entry), &uri, &uri_len, &name, &name_len, &is_id) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ossb", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len, &is_id) == FAILURE) {
                return;
        }
 
@@ -1016,7 +1016,7 @@ PHP_FUNCTION(dom_element_set_id_attribute_node)
        int name_len;
        zend_bool is_id;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OOb", &id, U_CLASS_ENTRY(dom_element_class_entry), &node, U_CLASS_ENTRY(dom_attr_class_entry), &is_id) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OOb", &id, dom_element_class_entry, &node, dom_attr_class_entry, &is_id) == FAILURE) {
                return;
        }
 
index f11ba09ac5dcec84f755f848a4fc571183dd5fce..53ec62548ac1d88e99ed5cd059cc124aa4db821d 100644 (file)
@@ -50,8 +50,8 @@ PHP_METHOD(domentityreference, __construct)
        char *name;
        int name_len, name_valid;
 
-       php_set_error_handling(EH_THROW, U_CLASS_ENTRY(dom_domexception_class_entry) TSRMLS_CC);
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_entityreference_class_entry), &name, &name_len) == FAILURE) {
+       php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_entityreference_class_entry, &name, &name_len) == FAILURE) {
                php_std_error_handling();
                return;
        }
index 76fcda8a7a63adf55895167af34b070eed5f9009..53707d02fbd04bdc1348c17cebddf2a91173e8e1 100644 (file)
@@ -104,7 +104,7 @@ PHP_FUNCTION(dom_namednodemap_get_named_item)
        xmlNodePtr nodep;
        xmlNotation *notep = NULL;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_namednodemap_class_entry), &named, &namedlen) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_namednodemap_class_entry, &named, &namedlen) == FAILURE) {
                return;
        }
 
@@ -176,7 +176,7 @@ PHP_FUNCTION(dom_namednodemap_item)
        xmlNodePtr nodep, curnode;
        int count;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &id, U_CLASS_ENTRY(dom_namednodemap_class_entry), &index) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &id, dom_namednodemap_class_entry, &index) == FAILURE) {
                return;
        }
        if (index >= 0) {
@@ -232,7 +232,7 @@ PHP_FUNCTION(dom_namednodemap_get_named_item_ns)
        xmlNodePtr nodep;
        xmlNotation *notep = NULL;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, U_CLASS_ENTRY(dom_namednodemap_class_entry), &uri, &urilen, &named, &namedlen) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_namednodemap_class_entry, &uri, &urilen, &named, &namedlen) == FAILURE) {
                return;
        }
 
index 6630dc13adfc5a6900c5a1d4015eb8dd889487c2..0efe9bb252961fa2bd3bdb7f906584fdf7016033 100644 (file)
@@ -913,7 +913,7 @@ PHP_FUNCTION(dom_node_insert_before)
        dom_object *intern, *childobj, *refpobj;
        int ret, stricterror;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO|O!", &id, U_CLASS_ENTRY(dom_node_class_entry), &node, U_CLASS_ENTRY(dom_node_class_entry), &ref, U_CLASS_ENTRY(dom_node_class_entry)) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO|O!", &id, dom_node_class_entry, &node, dom_node_class_entry, &ref, dom_node_class_entry) == FAILURE) {
                return;
        }
 
@@ -1077,7 +1077,7 @@ PHP_FUNCTION(dom_node_replace_child)
 
        int ret;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OOO", &id, U_CLASS_ENTRY(dom_node_class_entry), &newnode, U_CLASS_ENTRY(dom_node_class_entry), &oldnode, U_CLASS_ENTRY(dom_node_class_entry)) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OOO", &id, dom_node_class_entry, &newnode, dom_node_class_entry, &oldnode, dom_node_class_entry) == FAILURE) {
                return;
        }
 
@@ -1167,7 +1167,7 @@ PHP_FUNCTION(dom_node_remove_child)
        dom_object *intern, *childobj;
        int ret, stricterror;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, U_CLASS_ENTRY(dom_node_class_entry), &node, U_CLASS_ENTRY(dom_node_class_entry)) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_node_class_entry, &node, dom_node_class_entry) == FAILURE) {
                return;
        }
 
@@ -1220,7 +1220,7 @@ PHP_FUNCTION(dom_node_append_child)
        dom_object *intern, *childobj;
        int ret, stricterror;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, U_CLASS_ENTRY(dom_node_class_entry), &node, U_CLASS_ENTRY(dom_node_class_entry)) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_node_class_entry, &node, dom_node_class_entry) == FAILURE) {
                return;
        }
 
@@ -1321,7 +1321,7 @@ PHP_FUNCTION(dom_node_has_child_nodes)
        xmlNode *nodep;
        dom_object *intern;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, U_CLASS_ENTRY(dom_node_class_entry)) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_node_class_entry) == FAILURE) {
                return;
        }
 
@@ -1353,7 +1353,7 @@ PHP_FUNCTION(dom_node_clone_node)
        dom_object *intern;
        long recursive = 0;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", &id, U_CLASS_ENTRY(dom_node_class_entry), &recursive) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", &id, dom_node_class_entry, &recursive) == FAILURE) {
                return;
        }
 
@@ -1414,7 +1414,7 @@ PHP_FUNCTION(dom_node_normalize)
        xmlNode *nodep;
        dom_object *intern;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, U_CLASS_ENTRY(dom_node_class_entry)) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_node_class_entry) == FAILURE) {
                return;
        }
 
@@ -1436,7 +1436,7 @@ PHP_FUNCTION(dom_node_is_supported)
        int feature_len, version_len;
        char *feature, *version;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, U_CLASS_ENTRY(dom_node_class_entry), &feature, &feature_len, &version, &version_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, dom_node_class_entry, &feature, &feature_len, &version, &version_len) == FAILURE) {
                return;
        }
 
@@ -1459,7 +1459,7 @@ PHP_FUNCTION(dom_node_has_attributes)
        xmlNode *nodep;
        dom_object *intern;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, U_CLASS_ENTRY(dom_node_class_entry)) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_node_class_entry) == FAILURE) {
                return;
        }
 
@@ -1497,7 +1497,7 @@ PHP_FUNCTION(dom_node_is_same_node)
        xmlNodePtr nodeotherp, nodep;
        dom_object *intern, *nodeotherobj;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, U_CLASS_ENTRY(dom_node_class_entry), &node, U_CLASS_ENTRY(dom_node_class_entry)) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_node_class_entry, &node, dom_node_class_entry) == FAILURE) {
                return;
        }
 
@@ -1527,7 +1527,7 @@ PHP_FUNCTION(dom_node_lookup_prefix)
        int uri_len = 0;
        char *uri;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_node_class_entry), &uri, &uri_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_node_class_entry, &uri, &uri_len) == FAILURE) {
                return;
        }
 
@@ -1578,7 +1578,7 @@ PHP_FUNCTION(dom_node_is_default_namespace)
        int uri_len = 0;
        char *uri;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_node_class_entry), &uri, &uri_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_node_class_entry, &uri, &uri_len) == FAILURE) {
                return;
        }
 
@@ -1609,7 +1609,7 @@ PHP_FUNCTION(dom_node_lookup_namespace_uri)
        int prefix_len = 0;
        char *prefix;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, U_CLASS_ENTRY(dom_node_class_entry), &prefix, &prefix_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_node_class_entry, &prefix, &prefix_len) == FAILURE) {
                return;
        }
 
index 85e5c967addaee7ba280432b332036769962cf59..8989f907ad9e9af5d5dce4b273432fcb266a0023 100644 (file)
@@ -111,7 +111,7 @@ PHP_FUNCTION(dom_nodelist_item)
        HashTable *nodeht;
        zval **entry;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &id, U_CLASS_ENTRY(dom_nodelist_class_entry), &index) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &id, dom_nodelist_class_entry, &index) == FAILURE) {
                return;
        }
 
index c02605cd8917c47f6884c01be8202d0648989656..72560bf6de800a6d6ad6f4a3592434ec80f7f1c1 100644 (file)
@@ -1049,7 +1049,7 @@ void dom_objects_clone(void *object, void **object_clone TSRMLS_DC)
 
        clone = dom_objects_set_class(intern->std.ce, 0 TSRMLS_CC);
 
-       if (instanceof_function(intern->std.ce, U_CLASS_ENTRY(dom_node_class_entry) TSRMLS_CC)) {
+       if (instanceof_function(intern->std.ce, dom_node_class_entry TSRMLS_CC)) {
                node = (xmlNodePtr)dom_object_get_node((dom_object *) object);
                if (node != NULL) {
                        cloned_node = xmlDocCopyNode(node, node->doc, 1);
@@ -1170,9 +1170,9 @@ void php_dom_create_interator(zval *return_value, int ce_type TSRMLS_DC)
        zend_class_entry *ce;
 
        if (ce_type == DOM_NAMEDNODEMAP) {
-               ce = U_CLASS_ENTRY(dom_namednodemap_class_entry);
+               ce = dom_namednodemap_class_entry;
        } else {
-               ce = U_CLASS_ENTRY(dom_nodelist_class_entry);
+               ce = dom_nodelist_class_entry;
        }
 
        object_init_ex(return_value, ce);
@@ -1209,69 +1209,69 @@ PHP_DOM_EXPORT zval *php_dom_create_object(xmlNodePtr obj, int *found, zval *wra
                case XML_DOCUMENT_NODE:
                case XML_HTML_DOCUMENT_NODE:
                {
-                       ce = U_CLASS_ENTRY(dom_document_class_entry);
+                       ce = dom_document_class_entry;
                        break;
                }
                case XML_DTD_NODE:
                case XML_DOCUMENT_TYPE_NODE:
                {
-                       ce = U_CLASS_ENTRY(dom_documenttype_class_entry);
+                       ce = dom_documenttype_class_entry;
                        break;
                }
                case XML_ELEMENT_NODE:
                {
-                       ce = U_CLASS_ENTRY(dom_element_class_entry);
+                       ce = dom_element_class_entry;
                        break;
                }
                case XML_ATTRIBUTE_NODE:
                {
-                       ce = U_CLASS_ENTRY(dom_attr_class_entry);
+                       ce = dom_attr_class_entry;
                        break;
                }
                case XML_TEXT_NODE:
                {
-                       ce = U_CLASS_ENTRY(dom_text_class_entry);
+                       ce = dom_text_class_entry;
                        break;
                }
                case XML_COMMENT_NODE:
                {
-                       ce = U_CLASS_ENTRY(dom_comment_class_entry);
+                       ce = dom_comment_class_entry;
                        break;
                }
                case XML_PI_NODE:
                {
-                       ce = U_CLASS_ENTRY(dom_processinginstruction_class_entry);
+                       ce = dom_processinginstruction_class_entry;
                        break;
                }
                case XML_ENTITY_REF_NODE:
                {
-                       ce = U_CLASS_ENTRY(dom_entityreference_class_entry);
+                       ce = dom_entityreference_class_entry;
                        break;
                }
                case XML_ENTITY_DECL:
                case XML_ELEMENT_DECL:
                {
-                       ce = U_CLASS_ENTRY(dom_entity_class_entry);
+                       ce = dom_entity_class_entry;
                        break;
                }
                case XML_CDATA_SECTION_NODE:
                {
-                       ce = U_CLASS_ENTRY(dom_cdatasection_class_entry);
+                       ce = dom_cdatasection_class_entry;
                        break;
                }
                case XML_DOCUMENT_FRAG_NODE:
                {
-                       ce = U_CLASS_ENTRY(dom_documentfragment_class_entry);
+                       ce = dom_documentfragment_class_entry;
                        break;
                }
                case XML_NOTATION_NODE:
                {
-                       ce = U_CLASS_ENTRY(dom_notation_class_entry);
+                       ce = dom_notation_class_entry;
                        break;
                }
                case XML_NAMESPACE_DECL:
                {
-                       ce = U_CLASS_ENTRY(dom_namespace_node_class_entry);
+                       ce = dom_namespace_node_class_entry;
                        break;
                }
                default:
@@ -1300,7 +1300,7 @@ PHP_DOM_EXPORT zval *php_dom_create_object(xmlNodePtr obj, int *found, zval *wra
 
 
 void php_dom_create_implementation(zval **retval  TSRMLS_DC) {
-       object_init_ex(*retval, U_CLASS_ENTRY(dom_domimplementation_class_entry));
+       object_init_ex(*retval, dom_domimplementation_class_entry);
 }
 
 /* {{{ int dom_hierarchy(xmlNodePtr parent, xmlNodePtr child) */
index 00abbec13502fa7d85852ea1518a57a088a06601..a948b9603cfb46757cd90b45a71249580860dcca 100644 (file)
@@ -50,8 +50,8 @@ PHP_METHOD(domprocessinginstruction, __construct)
        char *name, *value = NULL;
        int name_len, value_len, name_valid;
 
-       php_set_error_handling(EH_THROW, U_CLASS_ENTRY(dom_domexception_class_entry) TSRMLS_CC);
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, U_CLASS_ENTRY(dom_processinginstruction_class_entry), &name, &name_len, &value, &value_len) == FAILURE) {
+       php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_processinginstruction_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
                php_std_error_handling();
                return;
        }
index 89537930f289b98ea1a382e1aa637268d11ba134..9124de9ea5e6e232c2540256c378239d3e2cc30e 100644 (file)
@@ -54,8 +54,8 @@ PHP_METHOD(domtext, __construct)
        char *value = NULL;
        int value_len;
 
-       php_set_error_handling(EH_THROW, U_CLASS_ENTRY(dom_domexception_class_entry) TSRMLS_CC);
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|s", &id, U_CLASS_ENTRY(dom_text_class_entry), &value, &value_len) == FAILURE) {
+       php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|s", &id, dom_text_class_entry, &value, &value_len) == FAILURE) {
                php_std_error_handling();
                return;
        }
@@ -125,7 +125,7 @@ PHP_FUNCTION(dom_text_split_text)
        int         length;
        dom_object      *intern;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &id, U_CLASS_ENTRY(dom_text_class_entry), &offset) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &id, dom_text_class_entry, &offset) == FAILURE) {
                return;
        }
        DOM_GET_OBJ(node, id, xmlNodePtr, intern);
@@ -177,7 +177,7 @@ PHP_FUNCTION(dom_text_is_whitespace_in_element_content)
        xmlNodePtr  node;
        dom_object      *intern;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, U_CLASS_ENTRY(dom_text_class_entry)) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_text_class_entry) == FAILURE) {
                return;
        }
        DOM_GET_OBJ(node, id, xmlNodePtr, intern);
index 9621530af30a1884511086332a1e49979d358d5f..6148880b80686ea147655d93812fbbfc5ddf9f4e 100644 (file)
@@ -52,8 +52,8 @@ PHP_METHOD(domxpath, __construct)
        dom_object *docobj, *intern;
        xmlXPathContextPtr ctx, oldctx;
 
-       php_set_error_handling(EH_THROW, U_CLASS_ENTRY(dom_domexception_class_entry) TSRMLS_CC);
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, U_CLASS_ENTRY(dom_xpath_class_entry), &doc, U_CLASS_ENTRY(dom_document_class_entry)) == FAILURE) {
+       php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_xpath_class_entry, &doc, dom_document_class_entry) == FAILURE) {
                php_std_error_handling();
                return;
        }
@@ -111,7 +111,7 @@ PHP_FUNCTION(dom_xpath_register_ns)
        dom_object *intern;
        unsigned char *prefix, *ns_uri;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, U_CLASS_ENTRY(dom_xpath_class_entry), &prefix, &prefix_len, &ns_uri, &ns_uri_len) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, dom_xpath_class_entry, &prefix, &prefix_len, &ns_uri, &ns_uri_len) == FAILURE) {
                return;
        }
 
@@ -151,7 +151,7 @@ static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) {
        xmlNsPtr *ns;
 
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|O", &id, U_CLASS_ENTRY(dom_xpath_class_entry), &expr, &expr_len, &context, U_CLASS_ENTRY(dom_node_class_entry)) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|O", &id, dom_xpath_class_entry, &expr, &expr_len, &context, dom_node_class_entry) == FAILURE) {
                return;
        }
 
index 6af310e879d4e1aeffff8f2a73f01ebfa5691eef..0a8830d923a8c62dc1487779be63d77d55cb3393 100755 (executable)
@@ -55,7 +55,7 @@ zend_class_entry *pdo_exception_ce;
 
 PDO_API zend_class_entry *php_pdo_get_exception(TSRMLS_D)
 {
-       return U_CLASS_ENTRY(pdo_exception_ce);
+       return pdo_exception_ce;
 }
 
 PDO_API char *php_pdo_str_tolower_dup(const char *src, int len)
index d66e15cbde3fe2688b769a0a5446ff0055fc9b0e..83b4e30ca35297fef2cc65eaf0bb6b9efb35732c 100755 (executable)
@@ -508,7 +508,7 @@ static PHP_METHOD(PDO, prepare)
                        RETURN_FALSE;
                }
                dbstmt_ce = *pce;
-               if (!instanceof_function(dbstmt_ce, U_CLASS_ENTRY(pdo_dbstmt_ce) TSRMLS_CC)) {
+               if (!instanceof_function(dbstmt_ce, pdo_dbstmt_ce TSRMLS_CC)) {
                        pdo_raise_impl_error(dbh, NULL, "HY000", 
                                "user-supplied statement class must be derived from PDOStatement" TSRMLS_CC);
                        PDO_HANDLE_DBH_ERR();
@@ -727,7 +727,7 @@ static PHP_METHOD(PDO, setAttribute)
                                PDO_HANDLE_DBH_ERR();
                                RETURN_FALSE;
                        }
-                       if (!instanceof_function(*pce, U_CLASS_ENTRY(pdo_dbstmt_ce) TSRMLS_CC)) {
+                       if (!instanceof_function(*pce, pdo_dbstmt_ce TSRMLS_CC)) {
                                pdo_raise_impl_error(dbh, NULL, "HY000", 
                                        "user-supplied statement class must be derived from PDOStatement" TSRMLS_CC);
                                PDO_HANDLE_DBH_ERR();
@@ -1372,7 +1372,7 @@ zend_object_value pdo_dbh_new(zend_class_entry *ce TSRMLS_DC)
        ALLOC_HASHTABLE(dbh->properties);
        zend_hash_init(dbh->properties, 0, NULL, ZVAL_PTR_DTOR, 0);
        zend_hash_copy(dbh->properties, &ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
-       dbh->def_stmt_ce = U_CLASS_ENTRY(pdo_dbstmt_ce);
+       dbh->def_stmt_ce = pdo_dbstmt_ce;
        
        retval.handle = zend_objects_store_put(dbh, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)pdo_dbh_free_storage, NULL TSRMLS_CC);
        retval.handlers = &pdo_dbh_object_handlers;
index 0b60d50a1a200f35423e8d6d1ad91a67ebbb3e34..73c33d77f01abdd8be146c9de1152b3d8203b7b4 100755 (executable)
@@ -1178,7 +1178,7 @@ static PHP_METHOD(PDOStatement, fetchObject)
        
        switch(ZEND_NUM_ARGS()) {
        case 0:
-               stmt->fetch.cls.ce = U_CLASS_ENTRY(zend_standard_class_def);
+               stmt->fetch.cls.ce = zend_standard_class_def;
                break;
        case 2:
                if (Z_TYPE_P(ctor_args) != IS_NULL && Z_TYPE_P(ctor_args) != IS_ARRAY) {
@@ -1274,7 +1274,7 @@ static PHP_METHOD(PDOStatement, fetchAll)
                switch(ZEND_NUM_ARGS()) {
                case 0:
                case 1:
-                       stmt->fetch.cls.ce = U_CLASS_ENTRY(zend_standard_class_def);
+                       stmt->fetch.cls.ce = zend_standard_class_def;
                        break;
                case 3:
                        if (Z_TYPE_P(ctor_args) != IS_NULL && Z_TYPE_P(ctor_args) != IS_ARRAY) {
@@ -2406,7 +2406,7 @@ static union _zend_function *row_get_ctor(zval *object TSRMLS_DC)
 
 static zend_class_entry *row_get_ce(zval *object TSRMLS_DC)
 {
-       return U_CLASS_ENTRY(pdo_dbstmt_ce);
+       return pdo_dbstmt_ce;
 }
 
 static int row_get_classname(zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC)
index 3746f350741f9b1d3128b94b36857c631b7674bf..da46f4947dc03f194354bd030c47362a0f71ffdb 100644 (file)
@@ -27,7 +27,6 @@
 
 #  define ZVAL_RT_STRINGL(a, b, c, d)          ZVAL_STRINGL(a, b, c, d)
 #  define ZVAL_ASCII_STRINGL(a, b, c, d)       ZVAL_STRINGL(a, b, c, d)
-#  define U_CLASS_ENTRY(ce)                                    ce
 #  define PDO_ZVAL_PP_IS_TEXT(pp)                      (Z_TYPE_PP(pp) == IS_STRING)
 #  define PDO_ZVAL_P_IS_TEXT(pp)                       (Z_TYPE_P(pp) == IS_STRING)
 #  define Z_UNIVAL_PP(x)                                       Z_STRVAL_PP(x)
index d4e1de0a0ccf48472e5113f060225cc3a8cfd8ef..c8af4f9b528e8f0021a25c87dca11bdaa6585832 100644 (file)
@@ -71,7 +71,7 @@ ZEND_DECLARE_MODULE_GLOBALS(reflection)
 /* Method macros */
 
 #define METHOD_NOTSTATIC(ce)                                                                                \
-       if (!this_ptr || !instanceof_function(Z_OBJCE_P(this_ptr), U_CLASS_ENTRY(ce) TSRMLS_CC)) {                             \
+       if (!this_ptr || !instanceof_function(Z_OBJCE_P(this_ptr), ce TSRMLS_CC)) {                             \
                zend_error(E_ERROR, "%v() cannot be called statically", get_active_function_name(TSRMLS_C));        \
                return;                                                                                             \
        }                                                                                                       \
@@ -83,11 +83,11 @@ ZEND_DECLARE_MODULE_GLOBALS(reflection)
 
 /* Exception throwing macro */
 #define _DO_THROW(msg)                                                                                      \
-       zend_throw_exception(U_CLASS_ENTRY(reflection_exception_ptr), msg, 0 TSRMLS_CC);                                       \
+       zend_throw_exception(reflection_exception_ptr, msg, 0 TSRMLS_CC);                                       \
        return;                                                                                                 \
 
 #define RETURN_ON_EXCEPTION                                                                                 \
-       if (EG(exception) && Z_OBJCE_P(EG(exception)) == U_CLASS_ENTRY(reflection_exception_ptr)) {                            \
+       if (EG(exception) && Z_OBJCE_P(EG(exception)) == reflection_exception_ptr) {                            \
                return;                                                                                             \
        }
 
@@ -960,7 +960,7 @@ PHPAPI void zend_reflection_class_factory(zend_class_entry *ce, zval *object TSR
 
        MAKE_STD_ZVAL(name);
        ZVAL_TEXTL(name, ce->name, ce->name_length, 1);
-       reflection_instanciate(U_CLASS_ENTRY(reflection_class_ptr), object TSRMLS_CC);
+       reflection_instanciate(reflection_class_ptr, object TSRMLS_CC);
        intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC);
        intern->ptr = ce;
        intern->free_ptr = 0;
@@ -986,7 +986,7 @@ static void reflection_extension_factory(zval *object, char *name_str TSRMLS_DC)
        }
        free_alloca(lcname);
 
-       reflection_instanciate(U_CLASS_ENTRY(reflection_extension_ptr), object TSRMLS_CC);
+       reflection_instanciate(reflection_extension_ptr, object TSRMLS_CC);
        intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC);
        MAKE_STD_ZVAL(name);
        ZVAL_STRINGL(name, module->name, name_len, 1);
@@ -1010,7 +1010,7 @@ static void reflection_parameter_factory(zend_function *fptr, struct _zend_arg_i
        } else {
                ZVAL_NULL(name);
        }
-       reflection_instanciate(U_CLASS_ENTRY(reflection_parameter_ptr), object TSRMLS_CC);
+       reflection_instanciate(reflection_parameter_ptr, object TSRMLS_CC);
        intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC);
        reference = (parameter_reference*) emalloc(sizeof(parameter_reference));
        reference->arg_info = arg_info;
@@ -1033,7 +1033,7 @@ static void reflection_function_factory(zend_function *function, zval *object TS
        MAKE_STD_ZVAL(name);
        ZVAL_TEXT(name, function->common.function_name, 1);
 
-       reflection_instanciate(U_CLASS_ENTRY(reflection_function_ptr), object TSRMLS_CC);
+       reflection_instanciate(reflection_function_ptr, object TSRMLS_CC);
        intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC);
        intern->ptr = function;
        intern->free_ptr = 0;
@@ -1053,7 +1053,7 @@ static void reflection_method_factory(zend_class_entry *ce, zend_function *metho
        MAKE_STD_ZVAL(classname);
        ZVAL_TEXT(name, method->common.function_name, 1);
        ZVAL_TEXTL(classname, ce->name, ce->name_length, 1);
-       reflection_instanciate(U_CLASS_ENTRY(reflection_method_ptr), object TSRMLS_CC);
+       reflection_instanciate(reflection_method_ptr, object TSRMLS_CC);
        intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC);
        intern->ptr = method;
        intern->free_ptr = 0;
@@ -1091,7 +1091,7 @@ static void reflection_property_factory(zend_class_entry *ce, zend_property_info
        ZVAL_TEXT(name, prop_name, 1);
        ZVAL_TEXTL(classname, ce->name, ce->name_length, 1);
 
-       reflection_instanciate(U_CLASS_ENTRY(reflection_property_ptr), object TSRMLS_CC);
+       reflection_instanciate(reflection_property_ptr, object TSRMLS_CC);
        intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC);
        reference = (property_reference*) emalloc(sizeof(property_reference));
        reference->ce = ce;
@@ -1175,7 +1175,7 @@ static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c
        params[1] = &output_ptr;
 
        ZVAL_STRINGL(&fname, "export", sizeof("export") - 1, 0);
-       fci.function_table = &U_CLASS_ENTRY(reflection_ptr)->function_table;
+       fci.function_table = &reflection_ptr->function_table;
        fci.function_name = &fname;
        fci.object_pp = NULL;
        fci.retval_ptr_ptr = &retval_ptr;
@@ -1218,7 +1218,7 @@ ZEND_METHOD(reflection, export)
        int result;
        zend_bool return_output = 0;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|b", &object, U_CLASS_ENTRY(reflector_ptr), &return_output) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|b", &object, reflector_ptr, &return_output) == FAILURE) {
                return;
        }
 
@@ -1290,7 +1290,7 @@ ZEND_METHOD(reflection, getModifierNames)
    Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */
 ZEND_METHOD(reflection_function, export)
 {
-       _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(reflection_function_ptr), 1);
+       _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, reflection_function_ptr, 1);
 }
 /* }}} */
 
@@ -1320,7 +1320,7 @@ ZEND_METHOD(reflection_function, __construct)
        lcname = zend_u_str_case_fold(type, name_str, name_len, 1, &lcname_len);
        if (zend_u_hash_find(EG(function_table), type, lcname, lcname_len + 1, (void **)&fptr) == FAILURE) {
                efree(lcname);
-               zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, 
+               zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                        "Function %R() does not exist", type, name_str);
                return;
        }
@@ -1511,7 +1511,7 @@ ZEND_METHOD(reflection_function, invoke)
        efree(params);
 
        if (result == FAILURE) {
-               zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, 
+               zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                        "Invocation of function %v() failed", fptr->common.function_name);
                return;
        }
@@ -1575,7 +1575,7 @@ ZEND_METHOD(reflection_function, invokeArgs)
        efree(params);
 
        if (result == FAILURE) {
-               zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, 
+               zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                        "Invocation of function %v() failed", fptr->common.function_name);
                return;
        }
@@ -1707,7 +1707,7 @@ ZEND_METHOD(reflection_function, getExtensionName)
    Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */
 ZEND_METHOD(reflection_parameter, export)
 {
-       _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(reflection_parameter_ptr), 2);
+       _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, reflection_parameter_ptr, 2);
 }
 /* }}} */
 
@@ -1746,7 +1746,7 @@ ZEND_METHOD(reflection_parameter, __construct)
                                lcname = zend_u_str_case_fold(Z_TYPE_P(reference), Z_UNIVAL_P(reference), Z_UNILEN_P(reference), 1, &lcname_len);
                                if (zend_u_hash_find(EG(function_table), Z_TYPE_P(reference), lcname, lcname_len + 1, (void**) &fptr) == FAILURE) {
                                        efree(lcname);
-                                       zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, 
+                                       zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                                                "Function %R() does not exist", Z_TYPE_P(reference), Z_UNIVAL_P(reference));
                                        return;
                                }
@@ -1772,7 +1772,7 @@ ZEND_METHOD(reflection_parameter, __construct)
                                } else {
                                        convert_to_text_ex(classref);
                                        if (zend_u_lookup_class(Z_TYPE_PP(classref), Z_UNIVAL_PP(classref), Z_UNILEN_PP(classref), &pce TSRMLS_CC) == FAILURE) {
-                                               zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC,
+                                               zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
                                                                "Class %R does not exist", Z_TYPE_PP(classref), Z_UNIVAL_PP(classref));
                                                return;
                                        }
@@ -1783,7 +1783,7 @@ ZEND_METHOD(reflection_parameter, __construct)
                                lcname = zend_u_str_case_fold(Z_TYPE_PP(method), Z_UNIVAL_PP(method), Z_UNILEN_PP(method), 1, &lcname_len);
                                if (zend_u_hash_find(&ce->function_table, Z_TYPE_PP(method), lcname, lcname_len + 1, (void **) &fptr) == FAILURE) {
                                        efree(lcname);
-                                       zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, 
+                                       zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                                                "Method %R::%R() does not exist", Z_TYPE_PP(classref), Z_UNIVAL_PP(classref), Z_TYPE_PP(method), Z_UNIVAL_PP(method));
                                        return;
                                }
@@ -1881,7 +1881,7 @@ ZEND_METHOD(reflection_parameter, getClass)
                zend_class_entry **pce;
 
                if (zend_u_lookup_class_ex(UG(unicode)?IS_UNICODE:IS_STRING, param->arg_info->class_name, param->arg_info->class_name_len, 1, &pce TSRMLS_CC) == FAILURE) {
-                       zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, 
+                       zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                                "Class %v does not exist", param->arg_info->class_name);
                        return;
                }
@@ -1986,16 +1986,16 @@ ZEND_METHOD(reflection_parameter, getDefaultValue)
 
        if (param->fptr->type != ZEND_USER_FUNCTION)
        {
-               zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, "Cannot determine default value for internal functions");
+               zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Cannot determine default value for internal functions");
                return;
        }
        if (param->offset < param->required) {
-               zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, "Parameter is not optional"); 
+               zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Parameter is not optional"); 
                return;
        }
        precv = _get_recv_op((zend_op_array*)param->fptr, param->offset);
        if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2.op_type == IS_UNUSED) {
-               zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, "Internal error"); 
+               zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Internal error"); 
                return;
        }
 
@@ -2010,7 +2010,7 @@ ZEND_METHOD(reflection_parameter, getDefaultValue)
    Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */
 ZEND_METHOD(reflection_method, export)
 {
-       _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(reflection_method_ptr), 2);
+       _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, reflection_method_ptr, 2);
 }
 /* }}} */
 
@@ -2057,7 +2057,7 @@ ZEND_METHOD(reflection_method, __construct)
                case IS_STRING:
                case IS_UNICODE:
                        if (zend_u_lookup_class(Z_TYPE_P(classname), Z_UNIVAL_P(classname), Z_UNILEN_P(classname), &pce TSRMLS_CC) == FAILURE) {
-                               zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC,
+                               zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
                                                "Class %v does not exist", Z_UNIVAL_P(classname)); 
                                return;
                        }
@@ -2086,7 +2086,7 @@ ZEND_METHOD(reflection_method, __construct)
 
        if (zend_u_hash_find(&ce->function_table, type, lcname, lcname_len + 1, (void **) &mptr) == FAILURE) {
                efree(lcname);
-               zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, 
+               zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                        "Method %v::%R() does not exist", ce->name, type, name_str);
                return;
        }
@@ -2144,11 +2144,11 @@ ZEND_METHOD(reflection_method, invoke)
        if (!(mptr->common.fn_flags & ZEND_ACC_PUBLIC) ||
                (mptr->common.fn_flags & ZEND_ACC_ABSTRACT)) {
                if (mptr->common.fn_flags & ZEND_ACC_ABSTRACT) {
-                       zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, 
+                       zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                                "Trying to invoke abstract method %v::%v()", 
                                mptr->common.scope->name, mptr->common.function_name);
                } else {
-                       zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC,
+                       zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
                                "Trying to invoke %s method %v::%v() from scope %v", 
                                mptr->common.fn_flags & ZEND_ACC_PROTECTED ? "protected" : "private",
                                mptr->common.scope->name, mptr->common.function_name,
@@ -2209,7 +2209,7 @@ ZEND_METHOD(reflection_method, invoke)
        efree(params);
 
        if (result == FAILURE) {
-               zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, 
+               zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                        "Invocation of method %v::%v() failed", mptr->common.scope->name, mptr->common.function_name);
                return;
        }
@@ -2247,11 +2247,11 @@ ZEND_METHOD(reflection_method, invokeArgs)
        if (!(mptr->common.fn_flags & ZEND_ACC_PUBLIC) ||
                (mptr->common.fn_flags & ZEND_ACC_ABSTRACT)) {
                if (mptr->common.fn_flags & ZEND_ACC_ABSTRACT) {
-                       zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, 
+                       zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                                "Trying to invoke abstract method %v::%v", 
                                mptr->common.scope->name, mptr->common.function_name);
                } else {
-                       zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC,
+                       zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
                                "Trying to invoke %s method %v::%v from scope %v", 
                                mptr->common.fn_flags & ZEND_ACC_PROTECTED ? "protected" : "private",
                                mptr->common.scope->name, mptr->common.function_name,
@@ -2278,7 +2278,7 @@ ZEND_METHOD(reflection_method, invokeArgs)
        } else {
                if (!object) {
                        efree(params);
-                       zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC,
+                       zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
                                "Trying to invoke non static method %v::%v without an object", 
                                mptr->common.scope->name, mptr->common.function_name);
                        return;
@@ -2313,7 +2313,7 @@ ZEND_METHOD(reflection_method, invokeArgs)
        efree(params);
 
        if (result == FAILURE) {
-               zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, 
+               zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                        "Invocation of method %v::%v() failed", mptr->common.scope->name, mptr->common.function_name);
                return;
        }
@@ -2440,7 +2440,7 @@ ZEND_METHOD(reflection_method, getPrototype)
        GET_REFLECTION_OBJECT_PTR(mptr);
        
        if (!mptr->common.prototype) {
-               zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, 
+               zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                        "Method %v::%v does not have a prototype", intern->ce->name, mptr->common.function_name);
                return;
        }
@@ -2453,7 +2453,7 @@ ZEND_METHOD(reflection_method, getPrototype)
    Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */
 ZEND_METHOD(reflection_class, export)
 {
-       _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(reflection_class_ptr), 1);
+       _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, reflection_class_ptr, 1);
 }
 /* }}} */
 
@@ -2495,7 +2495,7 @@ static void reflection_class_object_ctor(INTERNAL_FUNCTION_PARAMETERS, int is_ob
                convert_to_string_ex(&argument);
                if (zend_u_lookup_class(Z_TYPE_P(argument), Z_UNIVAL_P(argument), Z_UNILEN_P(argument), &ce TSRMLS_CC) == FAILURE) {
                        if (!EG(exception)) {
-                               zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), -1 TSRMLS_CC, "Class %R does not exist", Z_TYPE_P(argument), Z_UNIVAL_P(argument));
+                               zend_throw_exception_ex(reflection_exception_ptr, -1 TSRMLS_CC, "Class %R does not exist", Z_TYPE_P(argument), Z_UNIVAL_P(argument));
                        }
                        return;
                }
@@ -2559,7 +2559,7 @@ ZEND_METHOD(reflection_class, getStaticPropertyValue)
                if (def_value) {
                        RETURN_ZVAL(def_value, 1, 0);
                } else {
-                       zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, 
+                       zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                                "Class %v does not have a property named %R", ce->name, name_type, name);
                }
                return;
@@ -2591,7 +2591,7 @@ ZEND_METHOD(reflection_class, setStaticPropertyValue)
        zend_update_class_constants(ce TSRMLS_CC);
        variable_ptr = zend_std_get_static_property(ce, name_type, name, name_len, 1 TSRMLS_CC);
        if (!variable_ptr) {
-               zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, 
+               zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                                "Class %v does not have a property named %R", ce->name, name_type, name);
                return;
        }       
@@ -2837,7 +2837,7 @@ ZEND_METHOD(reflection_class, getMethod)
                efree(lc_name);
        } else {
                efree(lc_name);
-               zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, 
+               zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                                "Method %R does not exist", type, name);
                return;
        }
@@ -2952,7 +2952,7 @@ ZEND_METHOD(reflection_class, getProperty)
 
                if (zend_u_lookup_class(name_type, classname, classname_len, &pce TSRMLS_CC) == FAILURE) {
                        if (!EG(exception)) {
-                               zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), -1 TSRMLS_CC, "Class %R does not exist", name_type, classname);
+                               zend_throw_exception_ex(reflection_exception_ptr, -1 TSRMLS_CC, "Class %R does not exist", name_type, classname);
                        }
                        efree(classname);
                        return;
@@ -2960,7 +2960,7 @@ ZEND_METHOD(reflection_class, getProperty)
                efree(classname);
 
                if (!instanceof_function(ce, *pce TSRMLS_CC)) {
-                       zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), -1 TSRMLS_CC, "Fully qualified property name %v::%R does not specify a base class of %v", (*pce)->name, name_type, name, ce->name);
+                       zend_throw_exception_ex(reflection_exception_ptr, -1 TSRMLS_CC, "Fully qualified property name %v::%R does not specify a base class of %v", (*pce)->name, name_type, name, ce->name);
                        return;
                }
                ce = *pce;
@@ -2970,7 +2970,7 @@ ZEND_METHOD(reflection_class, getProperty)
                        return;
                }               
        }
-       zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, 
+       zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                        "Property %R does not exist", name_type, name);
 }
 /* }}} */
@@ -3196,7 +3196,7 @@ ZEND_METHOD(reflection_class, newInstance)
                zend_fcall_info_cache fcc;
 
                if (!(ce->constructor->common.fn_flags & ZEND_ACC_PUBLIC)) {
-                       zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, "Access to non-public constructor of class %v", ce->name);
+                       zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Access to non-public constructor of class %v", ce->name);
                        return;
                }
 
@@ -3236,7 +3236,7 @@ ZEND_METHOD(reflection_class, newInstance)
        } else if (!ZEND_NUM_ARGS()) {
                object_init_ex(return_value, ce);
        } else {
-               zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, "Class %v does not have a constructor, so you cannot pass any constructor arguments", ce->name);
+               zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Class %v does not have a constructor, so you cannot pass any constructor arguments", ce->name);
        }
 }
 /* }}} */
@@ -3267,7 +3267,7 @@ ZEND_METHOD(reflection_class, newInstanceArgs)
                zend_fcall_info_cache fcc;
 
                if (!(ce->constructor->common.fn_flags & ZEND_ACC_PUBLIC)) {
-                       zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, "Access to non-public constructor of class %v", ce->name);
+                       zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Access to non-public constructor of class %v", ce->name);
                        return;
                }
 
@@ -3305,7 +3305,7 @@ ZEND_METHOD(reflection_class, newInstanceArgs)
        } else if (!ZEND_NUM_ARGS()) {
                object_init_ex(return_value, ce);
        } else {
-               zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, "Class %v does not have a constructor, so you cannot pass any constructor arguments", ce->name);
+               zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Class %v does not have a constructor, so you cannot pass any constructor arguments", ce->name);
        }
 }
 /* }}} */
@@ -3373,14 +3373,14 @@ ZEND_METHOD(reflection_class, isSubclassOf)
                case IS_STRING:
                case IS_UNICODE:
                        if (zend_u_lookup_class(Z_TYPE_P(class_name), Z_UNIVAL_P(class_name), Z_UNILEN_P(class_name), &pce TSRMLS_CC) == FAILURE) {
-                               zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, 
+                               zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                                                "Interface %R does not exist", Z_TYPE_P(class_name), Z_UNIVAL_P(class_name));
                                return;
                        }
                        class_ce = *pce;
                        break;                  
                case IS_OBJECT:
-                       if (instanceof_function(Z_OBJCE_P(class_name), U_CLASS_ENTRY(reflection_class_ptr) TSRMLS_CC)) {
+                       if (instanceof_function(Z_OBJCE_P(class_name), reflection_class_ptr TSRMLS_CC)) {
                                argument = (reflection_object *) zend_object_store_get_object(class_name TSRMLS_CC);
                                if (argument == NULL || argument->ptr == NULL) {
                                        zend_error(E_ERROR, "Internal error: Failed to retrieve the argument's reflection object");
@@ -3391,7 +3391,7 @@ ZEND_METHOD(reflection_class, isSubclassOf)
                        }
                        /* no break */
                default:
-                       zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, 
+                       zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                                        "Parameter one must either be a string or a ReflectionClass object");
                        return;
        }
@@ -3420,14 +3420,14 @@ ZEND_METHOD(reflection_class, implementsInterface)
                case IS_STRING:
                case IS_UNICODE:
                        if (zend_u_lookup_class(Z_TYPE_P(interface), Z_UNIVAL_P(interface), Z_UNILEN_P(interface), &pce TSRMLS_CC) == FAILURE) {
-                               zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, 
+                               zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                                                "Interface %R does not exist", Z_TYPE_P(interface), Z_UNIVAL_P(interface));
                                return;
                        }
                        interface_ce = *pce;
                        break;                  
                case IS_OBJECT:
-                       if (instanceof_function(Z_OBJCE_P(interface), U_CLASS_ENTRY(reflection_class_ptr) TSRMLS_CC)) {
+                       if (instanceof_function(Z_OBJCE_P(interface), reflection_class_ptr TSRMLS_CC)) {
                                argument = (reflection_object *) zend_object_store_get_object(interface TSRMLS_CC);
                                if (argument == NULL || argument->ptr == NULL) {
                                        zend_error(E_ERROR, "Internal error: Failed to retrieve the argument's reflection object");
@@ -3438,13 +3438,13 @@ ZEND_METHOD(reflection_class, implementsInterface)
                        }
                        /* no break */
                default:
-                       zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, 
+                       zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                                        "Parameter one must either be a string or a ReflectionClass object");
                        return;
        }
 
        if (!(interface_ce->ce_flags & ZEND_ACC_INTERFACE)) {
-               zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, 
+               zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                                "Interface %v is a Class", interface_ce->name);
                return;
        }
@@ -3504,7 +3504,7 @@ ZEND_METHOD(reflection_class, getExtensionName)
    Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */
 ZEND_METHOD(reflection_object, export)
 {
-       _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(reflection_object_ptr), 1);
+       _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, reflection_object_ptr, 1);
 }
 /* }}} */
 
@@ -3520,7 +3520,7 @@ ZEND_METHOD(reflection_object, __construct)
    Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */
 ZEND_METHOD(reflection_property, export)
 {
-       _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(reflection_property_ptr), 2);
+       _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, reflection_property_ptr, 2);
 }
 /* }}} */
 
@@ -3554,7 +3554,7 @@ ZEND_METHOD(reflection_property, __construct)
                case IS_STRING:
                case IS_UNICODE:
                        if (zend_u_lookup_class(Z_TYPE_P(classname), Z_UNIVAL_P(classname), Z_UNILEN_P(classname), &pce TSRMLS_CC) == FAILURE) {
-                               zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC,
+                               zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
                                                "Class %R does not exist", Z_TYPE_P(classname), Z_UNIVAL_P(classname)); 
                                return;
                        }
@@ -3571,7 +3571,7 @@ ZEND_METHOD(reflection_property, __construct)
        }
 
        if (zend_u_hash_find(&ce->properties_info, name_type, name_str, name_len + 1, (void **) &property_info) == FAILURE || (property_info->flags & ZEND_ACC_SHADOW)) {
-               zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, 
+               zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                        "Property %v::$%R does not exist", ce->name, name_type, name_str);
                return;
        }
@@ -3839,7 +3839,7 @@ ZEND_METHOD(reflection_property, getDocComment)
    Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */
 ZEND_METHOD(reflection_extension, export)
 {
-       _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(reflection_extension_ptr), 1);
+       _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, reflection_extension_ptr, 1);
 }
 /* }}} */
 
@@ -3868,7 +3868,7 @@ ZEND_METHOD(reflection_extension, __construct)
        zend_str_tolower_copy(lcname, name_str, name_len);
        if (zend_hash_find(&module_registry, lcname, name_len + 1, (void **)&module) == FAILURE) {
                free_alloca(lcname);
-               zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, 
+               zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                        "Extension %s does not exist", name_str);
                return;
        }
@@ -4248,7 +4248,7 @@ static void _reflection_write_property(zval *object, zval *member, zval *value T
        && (ZEND_U_EQUAL(Z_TYPE_P(member), Z_UNIVAL_P(member), Z_UNILEN_P(member), "name", sizeof("name")-1) ||
            ZEND_U_EQUAL(Z_TYPE_P(member), Z_UNIVAL_P(member), Z_UNILEN_P(member), "class", sizeof("class")-1)))
        {
-               zend_throw_exception_ex(U_CLASS_ENTRY(reflection_exception_ptr), 0 TSRMLS_CC, 
+               zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                        "Cannot set read-only property %v::$%R", Z_OBJCE_P(object)->name, Z_TYPE_P(member), Z_UNIVAL_P(member));
        }
        else
index e747e08fbd95a23c9899f0788983a7a055c81f88..e0afb43db1df9c087955d7faaf924a0c81465a64 100644 (file)
@@ -6,7 +6,7 @@ use_trans_sid should not affect SID
 session.use_trans_sid=1
 session.use_cookies=0
 session.cache_limiter=
-arg_separator.output=&
+arg_separator.output="&"
 session.name=PHPSESSID
 session.serialize_handler=php
 session.save_handler=files
index 455c7f72046fe7656e51a9548d6d553dc5207ce2..82997a8f04cc530dd2302733e6920b7901215e37 100644 (file)
@@ -6,7 +6,7 @@ rewriter uses arg_seperator.output for modifying URLs
 session.use_cookies=0
 session.cache_limiter=
 session.use_trans_sid=1
-arg_separator.output=&amp;
+arg_separator.output="&amp;"
 session.name=PHPSESSID
 session.serialize_handler=php
 session.save_handler=files
index 6e7a997aa63633bc3d83f45d4e7679e7adabecc7..487c7d0d8f27736799d74d431ffd1d5bb913919f 100644 (file)
@@ -44,7 +44,7 @@ zend_class_entry *sxe_class_entry = NULL;
 
 ZEND_API zend_class_entry *sxe_get_element_class_entry(TSRMLS_D)
 {
-       return U_CLASS_ENTRY(sxe_class_entry);
+       return sxe_class_entry;
 }
 
 #define SXE_ME(func, arg_info, flags) PHP_ME(simplexml_element, func, arg_info, flags)
@@ -1585,7 +1585,7 @@ PHP_FUNCTION(simplexml_load_file)
        char           *classname = "";
        int             classname_len = 0;
        long            options = 0;
-       zend_class_entry *ce= U_CLASS_ENTRY(sxe_class_entry);
+       zend_class_entry *ce= sxe_class_entry;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sl", &filename, &filename_len, &classname, &classname_len, &options) == FAILURE) {
                return;
@@ -1629,7 +1629,7 @@ PHP_FUNCTION(simplexml_load_string)
        char           *classname = "";
        int             classname_len = 0;
        long            options = 0;
-       zend_class_entry *ce= U_CLASS_ENTRY(sxe_class_entry);
+       zend_class_entry *ce= sxe_class_entry;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sl", &data, &data_len, &classname, &classname_len, &options) == FAILURE) {
                return;
@@ -1896,7 +1896,7 @@ PHP_FUNCTION(simplexml_import_dom)
        xmlNodePtr              nodep = NULL;
        char           *classname = "";
        int             classname_len = 0;
-       zend_class_entry *ce= U_CLASS_ENTRY(sxe_class_entry);
+       zend_class_entry *ce= sxe_class_entry;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|s", &node, &classname, &classname_len) == FAILURE) {
                return;
index c5ab4a10df8fcfcf947b6e9b50be49772f358726..23a3290facf6ee7a67fec2e352e1e55a35018abc 100755 (executable)
@@ -145,7 +145,7 @@ PHP_FUNCTION(class_implements)
 /* }}} */
 
 #define SPL_ADD_CLASS(class_name, z_list, sub, allow, ce_flags) \
-       spl_add_classes(U_CLASS_ENTRY(spl_ce_ ## class_name), z_list, sub, allow, ce_flags TSRMLS_CC)
+       spl_add_classes(spl_ce_ ## class_name, z_list, sub, allow, ce_flags TSRMLS_CC)
 
 #define SPL_LIST_CLASSES(z_list, sub, allow, ce_flags) \
        SPL_ADD_CLASS(AppendIterator, z_list, sub, allow, ce_flags); \
@@ -298,7 +298,7 @@ PHP_FUNCTION(spl_autoload)
        EG(function_state_ptr) = original_function_state_ptr;
 
        if (!found) {
-               zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_LogicException), 0 TSRMLS_CC, "Class %s could not be loaded", class_name);
+               zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Class %s could not be loaded", class_name);
        }
 } /* }}} */
 
@@ -420,25 +420,25 @@ PHP_FUNCTION(spl_autoload_register)
                        if (Z_TYPE_P(zcallable) == IS_ARRAY) {
                                if (!obj_ptr && alfi.func_ptr && !(alfi.func_ptr->common.fn_flags & ZEND_ACC_STATIC)) {
                                        if (do_throw) {
-                                               zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_LogicException), 0 TSRMLS_CC, "Passed array specifies a non static method but no object");
+                                               zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Passed array specifies a non static method but no object");
                                        }
                                        zval_dtor(&zfunc_name);
                                        return;
                                }
                                else if (do_throw) {
-                                       zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_LogicException), 0 TSRMLS_CC, "Passed array does not specify %s %smethod", alfi.func_ptr ? "a callable" : "an existing", !obj_ptr ? "static " : "");
+                                       zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Passed array does not specify %s %smethod", alfi.func_ptr ? "a callable" : "an existing", !obj_ptr ? "static " : "");
                                }
                                zval_dtor(&zfunc_name);
                                return;
                        } else if (Z_TYPE_P(zcallable) == IS_STRING || Z_TYPE_P(zcallable) == IS_UNICODE) {
                                if (do_throw) {
-                                       zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_LogicException), 0 TSRMLS_CC, "Function '%R' not %s", Z_TYPE_P(zcallable), Z_UNIVAL_P(zcallable), alfi.func_ptr ? "callable" : "found");
+                                       zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Function '%R' not %s", Z_TYPE_P(zcallable), Z_UNIVAL_P(zcallable), alfi.func_ptr ? "callable" : "found");
                                }
                                zval_dtor(&zfunc_name);
                                return;
                        } else {
                                if (do_throw) {
-                                       zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_LogicException), 0 TSRMLS_CC, "Illegal value passed");
+                                       zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Illegal value passed");
                                }
                                zval_dtor(&zfunc_name);
                                return;
index 45f7a246d2805367720200eb363efb513edf4148..34d00328dd128698c19930db1e5e85e0fbcd59e2 100755 (executable)
@@ -156,11 +156,11 @@ static zend_object_value spl_array_object_new_ex(zend_class_entry *class_type, s
 
        retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) spl_array_object_free_storage, NULL TSRMLS_CC);
        while (parent) {
-               if (parent == U_CLASS_ENTRY(spl_ce_ArrayIterator) || parent == U_CLASS_ENTRY(spl_ce_RecursiveArrayIterator)) {
+               if (parent == spl_ce_ArrayIterator || parent == spl_ce_RecursiveArrayIterator) {
                        retval.handlers = &spl_handler_ArrayIterator;
                        class_type->get_iterator = spl_array_get_iterator;
                        break;
-               } else if (parent == U_CLASS_ENTRY(spl_ce_ArrayObject)) {
+               } else if (parent == spl_ce_ArrayObject) {
                        retval.handlers = &spl_handler_ArrayObject;
                        break;
                }
@@ -207,7 +207,7 @@ static zend_object_value spl_array_object_new_ex(zend_class_entry *class_type, s
                }
        }
 
-       intern->ce_get_iterator = U_CLASS_ENTRY(spl_ce_ArrayIterator);
+       intern->ce_get_iterator = spl_ce_ArrayIterator;
        zend_hash_internal_pointer_reset_ex(spl_array_get_hash_table(intern, 0 TSRMLS_CC), &intern->pos);
        return retval;
 }
@@ -332,7 +332,7 @@ static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval
        case IS_STRING:
        case IS_UNICODE:
                if (*(char*)Z_UNIVAL_P(offset) == '\0') {
-                       zend_throw_exception(U_CLASS_ENTRY(spl_ce_InvalidArgumentException), "An offset must not begin with \\0 or be empty", 0 TSRMLS_CC);
+                       zend_throw_exception(spl_ce_InvalidArgumentException, "An offset must not begin with \\0 or be empty", 0 TSRMLS_CC);
                        return;
                }
                value->refcount++;
@@ -845,7 +845,7 @@ SPL_METHOD(Array, __construct)
        if (ZEND_NUM_ARGS() == 0) {
                return; /* nothing to do */
        }
-       php_set_error_handling(EH_THROW, U_CLASS_ENTRY(spl_ce_InvalidArgumentException) TSRMLS_CC);
+       php_set_error_handling(EH_THROW, spl_ce_InvalidArgumentException TSRMLS_CC);
 
        intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
 
@@ -856,7 +856,7 @@ SPL_METHOD(Array, __construct)
 
        if (ZEND_NUM_ARGS() > 2) {
                if (zend_lookup_class(class_name, class_name_len, &pce_get_iterator TSRMLS_CC) == FAILURE) {
-                       zend_throw_exception(U_CLASS_ENTRY(spl_ce_InvalidArgumentException), "A class that implements Iterator must be specified", 0 TSRMLS_CC);
+                       zend_throw_exception(spl_ce_InvalidArgumentException, "A class that implements Iterator must be specified", 0 TSRMLS_CC);
                        php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
                        return;
                }
@@ -877,7 +877,7 @@ SPL_METHOD(Array, __construct)
        } else {
                if (Z_TYPE_P(array) != IS_OBJECT && Z_TYPE_P(array) != IS_ARRAY) {
                        php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
-                       zend_throw_exception(U_CLASS_ENTRY(spl_ce_InvalidArgumentException), "Passed variable is not an array or object, using empty array instead", 0 TSRMLS_CC);
+                       zend_throw_exception(spl_ce_InvalidArgumentException, "Passed variable is not an array or object, using empty array instead", 0 TSRMLS_CC);
                        return;
                }
                zval_ptr_dtor(&intern->array);
@@ -895,7 +895,7 @@ SPL_METHOD(Array, __construct)
                if ((handler != std_object_handlers.get_properties && handler != spl_array_get_properties)
                || !spl_array_get_hash_table(intern, 0 TSRMLS_CC)) {
                        php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
-                       zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_InvalidArgumentException), 0 TSRMLS_CC, "Overloaded object of type %s is not compatible with %s", Z_OBJCE_P(array)->name, intern->std.ce->name);
+                       zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Overloaded object of type %s is not compatible with %s", Z_OBJCE_P(array)->name, intern->std.ce->name);
                        return;
                }
        }
@@ -922,7 +922,7 @@ SPL_METHOD(Array, setIteratorClass)
        }
 
        if (zend_lookup_class(class_name, class_name_len, &pce_get_iterator TSRMLS_CC) == FAILURE) {
-               zend_throw_exception(U_CLASS_ENTRY(spl_ce_InvalidArgumentException), "A class that implements Iterator must be specified", 0 TSRMLS_CC);
+               zend_throw_exception(spl_ce_InvalidArgumentException, "A class that implements Iterator must be specified", 0 TSRMLS_CC);
                php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
                return;
        }
@@ -992,7 +992,7 @@ SPL_METHOD(Array, exchangeArray)
                intern->array = other->array;
        } else {
                if (Z_TYPE_PP(array) != IS_OBJECT && !HASH_OF(*array)) {
-                       zend_throw_exception(U_CLASS_ENTRY(spl_ce_InvalidArgumentException), "Passed variable is not an array or object, using empty array instead", 0 TSRMLS_CC);
+                       zend_throw_exception(spl_ce_InvalidArgumentException, "Passed variable is not an array or object, using empty array instead", 0 TSRMLS_CC);
                        return;
                }
                zval_ptr_dtor(&intern->array);
@@ -1072,7 +1072,7 @@ SPL_METHOD(Array, seek)
                        return; /* ok */
                }
        }
-       zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_OutOfBoundsException), 0 TSRMLS_CC, "Seek position %ld is out of range", opos);
+       zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0 TSRMLS_CC, "Seek position %ld is out of range", opos);
 } /* }}} */
 
 int spl_array_object_count_elements(zval *object, long *count TSRMLS_DC) /* {{{ */
@@ -1127,7 +1127,7 @@ static void spl_array_method(INTERNAL_FUNCTION_PARAMETERS, char *fname, int fnam
        
        if (use_arg) {
                if (ZEND_NUM_ARGS() != 1 || zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
-                       zend_throw_exception(U_CLASS_ENTRY(spl_ce_BadMethodCallException), "Function expects exactly one argument", 0 TSRMLS_CC);
+                       zend_throw_exception(spl_ce_BadMethodCallException, "Function expects exactly one argument", 0 TSRMLS_CC);
                        return;
                }
                zend_call_method(NULL, NULL, NULL, fname, fname_len, &return_value, 2, &tmp, arg TSRMLS_CC);
index 0e952ca39268a87d2e34e8b9ec8bc953047e2d32..04f72be878cbea88c17a5a11bf24d20f8ac33e35 100755 (executable)
@@ -131,8 +131,8 @@ static zend_object_value spl_filesystem_object_new_ex(zend_class_entry *class_ty
        memset(intern, 0, sizeof(spl_filesystem_object));
        intern->std.ce = class_type;
        /* intern->type = SPL_FS_INFO; done by set o */
-       intern->file_class = U_CLASS_ENTRY(spl_ce_SplFileObject);
-       intern->info_class = U_CLASS_ENTRY(spl_ce_SplFileInfo);
+       intern->file_class = spl_ce_SplFileObject;
+       intern->info_class = spl_ce_SplFileInfo;
        if (obj) *obj = intern;
 
        ALLOC_HASHTABLE(intern->std.properties);
@@ -206,7 +206,7 @@ static int spl_filesystem_file_open(spl_filesystem_object *intern, int use_inclu
 
        if (intern->u.file.stream == NULL) {
                if (!EG(exception)) {
-                       zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_RuntimeException), 0 TSRMLS_CC, "Cannot open file %s", intern->file_name);
+                       zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot open file %s", intern->file_name);
                }
                intern->file_name = NULL; /* until here it is not a copy */
                intern->u.file.open_mode = NULL;
@@ -301,7 +301,7 @@ static spl_filesystem_object * spl_filesystem_object_create_info(spl_filesystem_
        spl_filesystem_object *intern;
        
        if (!file_path || !file_path_len) {
-               zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_RuntimeException), 0 TSRMLS_CC, "Cannot create SplFileInfo for empty path");
+               zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot create SplFileInfo for empty path");
                if (file_path && !use_copy)
                {
                        efree(file_path);
@@ -309,7 +309,7 @@ static spl_filesystem_object * spl_filesystem_object_create_info(spl_filesystem_
                return NULL;
        }
 
-       php_set_error_handling(EH_THROW, U_CLASS_ENTRY(spl_ce_RuntimeException) TSRMLS_CC);
+       php_set_error_handling(EH_THROW, spl_ce_RuntimeException TSRMLS_CC);
 
        return_value->value.obj = spl_filesystem_object_new_ex(ce ? ce : source->info_class, &intern TSRMLS_CC);
        Z_TYPE_P(return_value) = IS_OBJECT;
@@ -326,7 +326,7 @@ static spl_filesystem_object * spl_filesystem_object_create_type(int ht, spl_fil
        spl_filesystem_object *intern;
        zend_bool use_include_path = 0;
 
-       php_set_error_handling(EH_THROW, U_CLASS_ENTRY(spl_ce_RuntimeException) TSRMLS_CC);
+       php_set_error_handling(EH_THROW, spl_ce_RuntimeException TSRMLS_CC);
 
        switch (source->type) {
        case SPL_FS_INFO:
@@ -334,7 +334,7 @@ static spl_filesystem_object * spl_filesystem_object_create_type(int ht, spl_fil
                break;
        case SPL_FS_DIR:
                if (!source->u.dir.entry.d_name[0]) {
-                       zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_RuntimeException), 0 TSRMLS_CC, "Could not open file");
+                       zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Could not open file");
                        php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
                        return NULL;
                }
@@ -381,7 +381,7 @@ static spl_filesystem_object * spl_filesystem_object_create_type(int ht, spl_fil
                break;
        case SPL_FS_DIR:        
                php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
-               zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_RuntimeException), 0 TSRMLS_CC, "Operation not supported");
+               zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Operation not supported");
                return NULL;
        }
        php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
@@ -396,7 +396,7 @@ SPL_METHOD(DirectoryIterator, __construct)
        char *path;
        int len;
 
-       php_set_error_handling(EH_THROW, U_CLASS_ENTRY(spl_ce_RuntimeException) TSRMLS_CC);
+       php_set_error_handling(EH_THROW, spl_ce_RuntimeException TSRMLS_CC);
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &path, &len) == FAILURE) {
                php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
@@ -411,7 +411,7 @@ SPL_METHOD(DirectoryIterator, __construct)
 
        intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
        spl_filesystem_dir_open(intern, path TSRMLS_CC);
-       intern->u.dir.is_recursive = instanceof_function(intern->std.ce, U_CLASS_ENTRY(spl_ce_RecursiveDirectoryIterator) TSRMLS_CC) ? 1 : 0;
+       intern->u.dir.is_recursive = instanceof_function(intern->std.ce, spl_ce_RecursiveDirectoryIterator TSRMLS_CC) ? 1 : 0;
        intern->flags = 0;
 
        php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
@@ -596,7 +596,7 @@ SPL_METHOD(SplFileInfo, __construct)
        char *path;
        int len;
 
-       php_set_error_handling(EH_THROW, U_CLASS_ENTRY(spl_ce_RuntimeException) TSRMLS_CC);
+       php_set_error_handling(EH_THROW, spl_ce_RuntimeException TSRMLS_CC);
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &path, &len) == FAILURE) {
                php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
@@ -714,7 +714,7 @@ SPL_METHOD(SplFileInfo, openFile)
 SPL_METHOD(SplFileInfo, setFileClass)
 {
        spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
-       zend_class_entry *ce = U_CLASS_ENTRY(spl_ce_SplFileObject);
+       zend_class_entry *ce = spl_ce_SplFileObject;
        
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|C", &ce) == FAILURE) {
                return;
@@ -729,7 +729,7 @@ SPL_METHOD(SplFileInfo, setFileClass)
 SPL_METHOD(SplFileInfo, setInfoClass)
 {
        spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
-       zend_class_entry *ce = U_CLASS_ENTRY(spl_ce_SplFileInfo);
+       zend_class_entry *ce = spl_ce_SplFileInfo;
        
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|C", &ce) == FAILURE) {
                return;
@@ -778,7 +778,7 @@ SPL_METHOD(RecursiveDirectoryIterator, __construct)
        int len;
        long flags = SPL_FILE_DIR_CURRENT_AS_FILEINFO;
 
-       php_set_error_handling(EH_THROW, U_CLASS_ENTRY(spl_ce_RuntimeException) TSRMLS_CC);
+       php_set_error_handling(EH_THROW, spl_ce_RuntimeException TSRMLS_CC);
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &path, &len, &flags) == FAILURE) {
                php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
@@ -787,7 +787,7 @@ SPL_METHOD(RecursiveDirectoryIterator, __construct)
 
        intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
        spl_filesystem_dir_open(intern, path TSRMLS_CC);
-       intern->u.dir.is_recursive = instanceof_function(intern->std.ce, U_CLASS_ENTRY(spl_ce_RecursiveDirectoryIterator) TSRMLS_CC) ? 1 : 0;
+       intern->u.dir.is_recursive = instanceof_function(intern->std.ce, spl_ce_RecursiveDirectoryIterator TSRMLS_CC) ? 1 : 0;
        intern->flags = flags;
 
        php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
@@ -869,7 +869,7 @@ SPL_METHOD(RecursiveDirectoryIterator, getChildren)
        INIT_PZVAL(&zpath);
        ZVAL_STRINGL(&zpath, intern->file_name, intern->file_name_len, 0);
 
-       spl_instantiate_arg_ex1(U_CLASS_ENTRY(spl_ce_RecursiveDirectoryIterator), &return_value, 0, &zpath TSRMLS_CC);
+       spl_instantiate_arg_ex1(spl_ce_RecursiveDirectoryIterator, &return_value, 0, &zpath TSRMLS_CC);
        
        subdir = (spl_filesystem_object*)zend_object_store_get_object(return_value TSRMLS_CC);
        if (subdir) {
@@ -1317,7 +1317,7 @@ static int spl_filesystem_file_read(spl_filesystem_object *intern, int silent TS
        
        if (php_stream_eof(intern->u.file.stream)) {
                if (!silent) {
-                       zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_RuntimeException), 0 TSRMLS_CC, "Cannot read from file %s", intern->file_name);
+                       zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot read from file %s", intern->file_name);
                }
                return FAILURE;
        }
@@ -1351,10 +1351,10 @@ static int spl_filesystem_file_read_line(zval * this_ptr, spl_filesystem_object
        zval *retval;
 
        /* if overloaded call the function, otherwise do it directly */
-       if (intern->u.file.func_getCurr->common.scope != U_CLASS_ENTRY(spl_ce_SplFileObject)) {
+       if (intern->u.file.func_getCurr->common.scope != spl_ce_SplFileObject) {
                if (php_stream_eof(intern->u.file.stream)) {
                        if (!silent) {
-                               zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_RuntimeException), 0 TSRMLS_CC, "Cannot read from file %s", intern->file_name);
+                               zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot read from file %s", intern->file_name);
                        }
                        return FAILURE;
                }
@@ -1384,7 +1384,7 @@ static int spl_filesystem_file_read_line(zval * this_ptr, spl_filesystem_object
 static void spl_filesystem_file_rewind(spl_filesystem_object *intern TSRMLS_DC) /* {{{ */
 {
        if (-1 == php_stream_rewind(intern->u.file.stream)) {
-               zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_RuntimeException), 0 TSRMLS_CC, "Cannot rewind file %s", intern->file_name);
+               zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot rewind file %s", intern->file_name);
        } else {
                spl_filesystem_file_free_line(intern TSRMLS_CC);
                intern->u.file.current_line_num = 0;
@@ -1399,7 +1399,7 @@ SPL_METHOD(SplFileObject, __construct)
        zend_bool use_include_path = 0;
        char *p1, *p2;
 
-       php_set_error_handling(EH_THROW, U_CLASS_ENTRY(spl_ce_RuntimeException) TSRMLS_CC);
+       php_set_error_handling(EH_THROW, spl_ce_RuntimeException TSRMLS_CC);
 
        intern->u.file.open_mode = "r";
        intern->u.file.open_mode_len = 1;
@@ -1438,7 +1438,7 @@ SPL_METHOD(SplTempFileObject, __construct)
        char tmp_fname[48];
        spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
 
-       php_set_error_handling(EH_THROW, U_CLASS_ENTRY(spl_ce_RuntimeException) TSRMLS_CC);
+       php_set_error_handling(EH_THROW, spl_ce_RuntimeException TSRMLS_CC);
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &max_memory) == FAILURE) {
                php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
@@ -1586,7 +1586,7 @@ SPL_METHOD(SplFileObject, setMaxLineLen)
        }
 
        if (max_len < 0) {
-               zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_DomainException), 0 TSRMLS_CC, "Maximum line length must be greater than or equal zero");
+               zend_throw_exception_ex(spl_ce_DomainException, 0 TSRMLS_CC, "Maximum line length must be greater than or equal zero");
                return;
        }
        
@@ -1850,7 +1850,7 @@ SPL_METHOD(SplFileObject, ftruncate)
        }
 
        if (!php_stream_truncate_supported(intern->u.file.stream)) {
-               zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_LogicException), 0 TSRMLS_CC, "Can't truncate file %s", intern->file_name);
+               zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Can't truncate file %s", intern->file_name);
                RETURN_FALSE;
        }
        
@@ -1868,7 +1868,7 @@ SPL_METHOD(SplFileObject, seek)
                return;
        }
        if (line_pos < 0) {
-               zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_LogicException), 0 TSRMLS_CC, "Can't seek file %s to negative line %ld", intern->file_name, line_pos);
+               zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Can't seek file %s to negative line %ld", intern->file_name, line_pos);
                RETURN_FALSE;           
        }
        
index 0f7a40d657523d1ead0d0b664b14d2893fe985a6..72820049297cad787e5ae86589275c354a084496 100755 (executable)
@@ -265,11 +265,11 @@ next_step:
                                }
 
                                ce = child && Z_TYPE_P(child) == IS_OBJECT ? Z_OBJCE_P(child) : NULL;
-                               if (!ce || !instanceof_function(ce, U_CLASS_ENTRY(spl_ce_RecursiveIterator) TSRMLS_CC)) {
+                               if (!ce || !instanceof_function(ce, spl_ce_RecursiveIterator TSRMLS_CC)) {
                                        if (child) {
                                                zval_ptr_dtor(&child);
                                        }
-                                       zend_throw_exception(U_CLASS_ENTRY(spl_ce_UnexpectedValueException), "Objects returned by RecursiveIterator::getChildren() must implement RecursiveIterator", 0 TSRMLS_CC);
+                                       zend_throw_exception(spl_ce_UnexpectedValueException, "Objects returned by RecursiveIterator::getChildren() must implement RecursiveIterator", 0 TSRMLS_CC);
                                        return;
                                }
                                if (object->mode == RIT_CHILD_FIRST) {
@@ -313,7 +313,7 @@ static void spl_recursive_it_rewind_ex(spl_recursive_it_object *object, zval *zt
                sub_iter = object->iterators[object->level].iterator;
                sub_iter->funcs->dtor(sub_iter TSRMLS_CC);
                zval_ptr_dtor(&object->iterators[object->level--].zobject);
-               if (!object->endChildren || object->endChildren->common.scope != U_CLASS_ENTRY(spl_ce_RecursiveIteratorIterator)) {
+               if (!object->endChildren || object->endChildren->common.scope != spl_ce_RecursiveIteratorIterator) {
                        zend_call_method_with_0_params(&zthis, object->ce, &object->endChildren, "endchildren", NULL);
                }
        }
@@ -378,10 +378,10 @@ SPL_METHOD(RecursiveIteratorIterator, __construct)
        long                       mode = RIT_LEAVES_ONLY, flags = 0;
        int                        inc_refcount = 1;
 
-       php_set_error_handling(EH_THROW, U_CLASS_ENTRY(spl_ce_InvalidArgumentException) TSRMLS_CC);
+       php_set_error_handling(EH_THROW, spl_ce_InvalidArgumentException TSRMLS_CC);
 
        if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "o|ll", &iterator, &mode, &flags) == SUCCESS) {
-               if (instanceof_function(Z_OBJCE_P(iterator), U_CLASS_ENTRY(zend_ce_aggregate) TSRMLS_CC)) {
+               if (instanceof_function(Z_OBJCE_P(iterator), zend_ce_aggregate TSRMLS_CC)) {
                        zval *aggregate = iterator;
                        zend_call_method_with_0_params(&aggregate, Z_OBJCE_P(aggregate), &Z_OBJCE_P(aggregate)->iterator_funcs.zf_new_iterator, "getiterator", &iterator);
                        inc_refcount = 0;
@@ -389,12 +389,12 @@ SPL_METHOD(RecursiveIteratorIterator, __construct)
        } else {
                iterator = NULL;
        }
-       if (!iterator || !instanceof_function(Z_OBJCE_P(iterator), U_CLASS_ENTRY(spl_ce_RecursiveIterator) TSRMLS_CC)) {
+       if (!iterator || !instanceof_function(Z_OBJCE_P(iterator), spl_ce_RecursiveIterator TSRMLS_CC)) {
                if (iterator && !inc_refcount) {
                        zval_ptr_dtor(&iterator);
                }
                php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
-               zend_throw_exception(U_CLASS_ENTRY(spl_ce_InvalidArgumentException), "An instance of RecursiveIterator or IteratorAggregate creating it is required", 0 TSRMLS_CC);
+               zend_throw_exception(spl_ce_InvalidArgumentException, "An instance of RecursiveIterator or IteratorAggregate creating it is required", 0 TSRMLS_CC);
                return;
        }
 
@@ -408,31 +408,31 @@ SPL_METHOD(RecursiveIteratorIterator, __construct)
        intern->ce = Z_OBJCE_P(object);
 
        zend_hash_find(&intern->ce->function_table, "beginiteration", sizeof("beginiteration"), (void **) &intern->beginIteration);
-       if (intern->beginIteration->common.scope == U_CLASS_ENTRY(spl_ce_RecursiveIteratorIterator)) {
+       if (intern->beginIteration->common.scope == spl_ce_RecursiveIteratorIterator) {
                intern->beginIteration = NULL;
        }
        zend_hash_find(&intern->ce->function_table, "enditeration", sizeof("enditeration"), (void **) &intern->endIteration);
-       if (intern->endIteration->common.scope == U_CLASS_ENTRY(spl_ce_RecursiveIteratorIterator)) {
+       if (intern->endIteration->common.scope == spl_ce_RecursiveIteratorIterator) {
                intern->endIteration = NULL;
        }
        zend_hash_find(&intern->ce->function_table, "callhaschildren", sizeof("callHasChildren"), (void **) &intern->callHasChildren);
-       if (intern->callHasChildren->common.scope == U_CLASS_ENTRY(spl_ce_RecursiveIteratorIterator)) {
+       if (intern->callHasChildren->common.scope == spl_ce_RecursiveIteratorIterator) {
                intern->callHasChildren = NULL;
        }
        zend_hash_find(&intern->ce->function_table, "callgetchildren", sizeof("callGetChildren"), (void **) &intern->callGetChildren);
-       if (intern->callGetChildren->common.scope == U_CLASS_ENTRY(spl_ce_RecursiveIteratorIterator)) {
+       if (intern->callGetChildren->common.scope == spl_ce_RecursiveIteratorIterator) {
                intern->callGetChildren = NULL;
        }
        zend_hash_find(&intern->ce->function_table, "beginchildren", sizeof("beginchildren"), (void **) &intern->beginChildren);
-       if (intern->beginChildren->common.scope == U_CLASS_ENTRY(spl_ce_RecursiveIteratorIterator)) {
+       if (intern->beginChildren->common.scope == spl_ce_RecursiveIteratorIterator) {
                intern->beginChildren = NULL;
        }
        zend_hash_find(&intern->ce->function_table, "endchildren", sizeof("endchildren"), (void **) &intern->endChildren);
-       if (intern->endChildren->common.scope == U_CLASS_ENTRY(spl_ce_RecursiveIteratorIterator)) {
+       if (intern->endChildren->common.scope == spl_ce_RecursiveIteratorIterator) {
                intern->endChildren = NULL;
        }
        zend_hash_find(&intern->ce->function_table, "nextelement", sizeof("nextElement"), (void **) &intern->nextElement);
-       if (intern->nextElement->common.scope == U_CLASS_ENTRY(spl_ce_RecursiveIteratorIterator)) {
+       if (intern->nextElement->common.scope == spl_ce_RecursiveIteratorIterator) {
                intern->nextElement = NULL;
        }
        ce_iterator = Z_OBJCE_P(iterator); /* respect inheritance, don't use spl_ce_RecursiveIterator */
@@ -633,7 +633,7 @@ SPL_METHOD(RecursiveIteratorIterator, setMaxDepth)
                return;
        }
        if (max_depth < -1) {
-               zend_throw_exception(U_CLASS_ENTRY(spl_ce_OutOfRangeException), "Parameter max_depth must be >= -1", 0 TSRMLS_CC);
+               zend_throw_exception(spl_ce_OutOfRangeException, "Parameter max_depth must be >= -1", 0 TSRMLS_CC);
                return;
        }
        object->max_depth = max_depth;
@@ -842,7 +842,7 @@ static inline spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAME
        int                   inc_refcount = 1;
 
 
-       php_set_error_handling(EH_THROW, U_CLASS_ENTRY(spl_ce_InvalidArgumentException) TSRMLS_CC);
+       php_set_error_handling(EH_THROW, spl_ce_InvalidArgumentException TSRMLS_CC);
 
        intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
 
@@ -857,12 +857,12 @@ static inline spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAME
                        }
                        if (intern->u.limit.offset < 0) {
                                php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
-                               zend_throw_exception(U_CLASS_ENTRY(spl_ce_OutOfRangeException), "Parameter offset must be > 0", 0 TSRMLS_CC);
+                               zend_throw_exception(spl_ce_OutOfRangeException, "Parameter offset must be > 0", 0 TSRMLS_CC);
                                return NULL;
                        }
                        if (intern->u.limit.count < 0 && intern->u.limit.count != -1) {
                                php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
-                               zend_throw_exception(U_CLASS_ENTRY(spl_ce_OutOfRangeException), "Parameter count must either be -1 or a value greater than or equal 0", 0 TSRMLS_CC);
+                               zend_throw_exception(spl_ce_OutOfRangeException, "Parameter count must either be -1 or a value greater than or equal 0", 0 TSRMLS_CC);
                                return NULL;
                        }
                        break;
@@ -877,7 +877,7 @@ static inline spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAME
                        if (((flags & CIT_CALL_TOSTRING) && (flags & (CIT_TOSTRING_USE_KEY|CIT_TOSTRING_USE_CURRENT)))
                        || ((flags & (CIT_TOSTRING_USE_KEY|CIT_TOSTRING_USE_CURRENT)) == (CIT_TOSTRING_USE_KEY|CIT_TOSTRING_USE_CURRENT))) {
                                php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
-                               zend_throw_exception(U_CLASS_ENTRY(spl_ce_InvalidArgumentException), "Flags must contain only one of CATCH_GET_CHILD, CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT", 0 TSRMLS_CC);
+                               zend_throw_exception(spl_ce_InvalidArgumentException, "Flags must contain only one of CATCH_GET_CHILD, CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT", 0 TSRMLS_CC);
                                return NULL;
                        }
                        intern->u.caching.flags |= flags & CIT_PUBLIC;
@@ -895,22 +895,22 @@ static inline spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAME
                                return NULL;
                        }
                        ce = Z_OBJCE_P(zobject);
-                       if (!instanceof_function(ce, U_CLASS_ENTRY(zend_ce_iterator) TSRMLS_CC)) {
+                       if (!instanceof_function(ce, zend_ce_iterator TSRMLS_CC)) {
                                if (ZEND_NUM_ARGS() > 1) {
                                        if (zend_lookup_class(class_name, class_name_len, &pce_cast TSRMLS_CC) == FAILURE 
                                        || !instanceof_function(ce, *pce_cast TSRMLS_CC)
                                        || !(*pce_cast)->get_iterator
                                        ) {
-                                               zend_throw_exception(U_CLASS_ENTRY(spl_ce_LogicException), "Class to downcast to not found or not base class or does not implement Traversable", 0 TSRMLS_CC);
+                                               zend_throw_exception(spl_ce_LogicException, "Class to downcast to not found or not base class or does not implement Traversable", 0 TSRMLS_CC);
                                                php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
                                                return NULL;
                                        }
                                        ce = *pce_cast;
                                }
-                               if (instanceof_function(ce, U_CLASS_ENTRY(zend_ce_aggregate) TSRMLS_CC)) {
+                               if (instanceof_function(ce, zend_ce_aggregate TSRMLS_CC)) {
                                        zend_call_method_with_0_params(&zobject, ce, &ce->iterator_funcs.zf_new_iterator, "getiterator", &retval);
-                                       if (!retval || Z_TYPE_P(retval) != IS_OBJECT || !instanceof_function(Z_OBJCE_P(retval), U_CLASS_ENTRY(zend_ce_traversable) TSRMLS_CC)) {
-                                               zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_LogicException), 0 TSRMLS_CC, "%s::getIterator() must return an object that implememnts Traversable", ce->name);
+                                       if (!retval || Z_TYPE_P(retval) != IS_OBJECT || !instanceof_function(Z_OBJCE_P(retval), zend_ce_traversable TSRMLS_CC)) {
+                                               zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "%s::getIterator() must return an object that implememnts Traversable", ce->name);
                                                php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
                                                return NULL;
                                        }
@@ -922,9 +922,9 @@ static inline spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAME
                        break;
                }
                case DIT_AppendIterator:
-                       spl_instantiate(U_CLASS_ENTRY(spl_ce_ArrayIterator), &intern->u.append.zarrayit, 1 TSRMLS_CC);
-                       zend_call_method_with_0_params(&intern->u.append.zarrayit, U_CLASS_ENTRY(spl_ce_ArrayIterator), &U_CLASS_ENTRY(spl_ce_ArrayIterator)->constructor, "__construct", NULL);
-                       intern->u.append.iterator = U_CLASS_ENTRY(spl_ce_ArrayIterator)->get_iterator(U_CLASS_ENTRY(spl_ce_ArrayIterator), intern->u.append.zarrayit, 0 TSRMLS_CC);
+                       spl_instantiate(spl_ce_ArrayIterator, &intern->u.append.zarrayit, 1 TSRMLS_CC);
+                       zend_call_method_with_0_params(&intern->u.append.zarrayit, spl_ce_ArrayIterator, &spl_ce_ArrayIterator->constructor, "__construct", NULL);
+                       intern->u.append.iterator = spl_ce_ArrayIterator->get_iterator(spl_ce_ArrayIterator, intern->u.append.zarrayit, 0 TSRMLS_CC);
                        php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
                        return intern;
 #if HAVE_PCRE || HAVE_BUNDLED_PCRE
@@ -970,7 +970,7 @@ static inline spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAME
    Create an Iterator from another iterator */
 SPL_METHOD(dual_it, __construct)
 {
-       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(zend_ce_iterator), DIT_Default);
+       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, zend_ce_iterator, DIT_Default);
 } /* }}} */
 
 /* {{{ proto Iterator FilterIterator::getInnerIterator() 
@@ -1212,7 +1212,7 @@ SPL_METHOD(FilterIterator, next)
    Create a RecursiveFilterIterator from a RecursiveIterator */
 SPL_METHOD(RecursiveFilterIterator, __construct)
 {
-       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(spl_ce_RecursiveIterator), DIT_Default);
+       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, spl_ce_RecursiveIterator, DIT_Default);
 } /* }}} */
 
 /* {{{ proto boolean RecursiveFilterIterator::hasChildren()
@@ -1246,7 +1246,7 @@ SPL_METHOD(RecursiveFilterIterator, getChildren)
    Create a ParentIterator from a RecursiveIterator */
 SPL_METHOD(ParentIterator, __construct)
 {
-       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(spl_ce_RecursiveIterator), DIT_Default);
+       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, spl_ce_RecursiveIterator, DIT_Default);
 } /* }}} */
 
 /* {{{ proto boolean ParentIterator::hasChildren()
@@ -1281,7 +1281,7 @@ SPL_METHOD(ParentIterator, getChildren)
    Create an RegExIterator from another iterator and a regular expression */
 SPL_METHOD(RegExIterator, __construct)
 {
-       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(zend_ce_iterator), DIT_RegExIterator);
+       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, zend_ce_iterator, DIT_RegExIterator);
 } /* }}} */
 
 /* {{{ proto bool RegExIterator::accept()
@@ -1330,7 +1330,7 @@ SPL_METHOD(RegExIterator, accept)
    Create an RecursiveRegExIterator from another recursive iterator and a regular expression */
 SPL_METHOD(RecursiveRegExIterator, __construct)
 {
-       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(spl_ce_RecursiveIterator), DIT_RecursiveRegExIterator);
+       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, spl_ce_RecursiveIterator, DIT_RecursiveRegExIterator);
 } /* }}} */
 #endif
 
@@ -1473,14 +1473,14 @@ static inline void spl_limit_it_seek(spl_dual_it_object *intern, long pos TSRMLS
 
        spl_dual_it_free(intern TSRMLS_CC);
        if (pos < intern->u.limit.offset) {
-               zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_OutOfBoundsException), 0 TSRMLS_CC, "Cannot seek to %ld which is below the offset %ld", pos, intern->u.limit.offset);
+               zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0 TSRMLS_CC, "Cannot seek to %ld which is below the offset %ld", pos, intern->u.limit.offset);
                return;
        }
        if (pos > intern->u.limit.offset + intern->u.limit.count && intern->u.limit.count != -1) {
-               zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_OutOfBoundsException), 0 TSRMLS_CC, "Cannot seek to %ld which is behind offest %ld plus count %ld", pos, intern->u.limit.offset, intern->u.limit.count);
+               zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0 TSRMLS_CC, "Cannot seek to %ld which is behind offest %ld plus count %ld", pos, intern->u.limit.offset, intern->u.limit.count);
                return;
        }
-       if (instanceof_function(intern->inner.ce, U_CLASS_ENTRY(spl_ce_SeekableIterator) TSRMLS_CC)) {
+       if (instanceof_function(intern->inner.ce, spl_ce_SeekableIterator TSRMLS_CC)) {
                MAKE_STD_ZVAL(zpos);
                ZVAL_LONG(zpos, pos);
                spl_dual_it_free(intern TSRMLS_CC);
@@ -1509,7 +1509,7 @@ static inline void spl_limit_it_seek(spl_dual_it_object *intern, long pos TSRMLS
    Construct a LimitIterator from an Iterator with a given starting offset and optionally a maximum count */
 SPL_METHOD(LimitIterator, __construct)
 {
-       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(zend_ce_iterator), DIT_LimitIterator);
+       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, zend_ce_iterator, DIT_LimitIterator);
 } /* }}} */
 
 /* {{{ proto void LimitIterator::rewind() 
@@ -1649,7 +1649,7 @@ static inline void spl_caching_it_next(spl_dual_it_object *intern TSRMLS_DC)
                                } else {
                                        INIT_PZVAL(&zflags);
                                        ZVAL_LONG(&zflags, intern->u.caching.flags & CIT_PUBLIC);
-                                       spl_instantiate_arg_ex2(U_CLASS_ENTRY(spl_ce_RecursiveCachingIterator), &intern->u.caching.zchildren, 1, zchildren, &zflags TSRMLS_CC);
+                                       spl_instantiate_arg_ex2(spl_ce_RecursiveCachingIterator, &intern->u.caching.zchildren, 1, zchildren, &zflags TSRMLS_CC);
                                        zval_ptr_dtor(&zchildren);
                                }
                        }
@@ -1692,7 +1692,7 @@ static inline void spl_caching_it_rewind(spl_dual_it_object *intern TSRMLS_DC)
    Construct a CachingIterator from an Iterator */
 SPL_METHOD(CachingIterator, __construct)
 {
-       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(zend_ce_iterator), DIT_CachingIterator);
+       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, zend_ce_iterator, DIT_CachingIterator);
 } /* }}} */
 
 /* {{{ proto void CachingIterator::rewind()
@@ -1748,7 +1748,7 @@ SPL_METHOD(CachingIterator, __toString)
        intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
 
        if (!(intern->u.caching.flags & (CIT_CALL_TOSTRING|CIT_TOSTRING_USE_KEY|CIT_TOSTRING_USE_CURRENT)))     {
-               zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_BadMethodCallException), 0 TSRMLS_CC, "%v does not fetch string value (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name);
+               zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%v does not fetch string value (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name);
        }
        if (intern->u.caching.flags & CIT_TOSTRING_USE_KEY) {
                if (intern->current.key_type == HASH_KEY_IS_STRING) {
@@ -1788,7 +1788,7 @@ SPL_METHOD(CachingIterator, offsetSet)
        intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
 
        if (!(intern->u.caching.flags & CIT_FULL_CACHE))        {
-               zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_BadMethodCallException), 0 TSRMLS_CC, "%v does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name);
+               zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%v does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name);
        }
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Tz", &arKey, &nKeyLength, &type, &value) == FAILURE) {
@@ -1813,7 +1813,7 @@ SPL_METHOD(CachingIterator, offsetGet)
        intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
 
        if (!(intern->u.caching.flags & CIT_FULL_CACHE))        {
-               zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_BadMethodCallException), 0 TSRMLS_CC, "%v does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name);
+               zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%v does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name);
        }
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "T", &arKey, &nKeyLength, &type) == FAILURE) {
@@ -1841,7 +1841,7 @@ SPL_METHOD(CachingIterator, offsetUnset)
        intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
 
        if (!(intern->u.caching.flags & CIT_FULL_CACHE))        {
-               zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_BadMethodCallException), 0 TSRMLS_CC, "%v does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name);
+               zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%v does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name);
        }
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "T", &arKey, &nKeyLength, &type) == FAILURE) {
@@ -1864,7 +1864,7 @@ SPL_METHOD(CachingIterator, offsetExists)
        intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
 
        if (!(intern->u.caching.flags & CIT_FULL_CACHE))        {
-               zend_throw_exception_ex(U_CLASS_ENTRY(spl_ce_BadMethodCallException), 0 TSRMLS_CC, "%v does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name);
+               zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%v does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name);
        }
        
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "T", &arKey, &nKeyLength, &type) == FAILURE) {
@@ -1906,7 +1906,7 @@ SPL_METHOD(CachingIterator, setFlags)
                return;
        }
        if ((intern->u.caching.flags & CIT_CALL_TOSTRING) != 0 && (flags & ~CIT_CALL_TOSTRING) == 0) {
-               zend_throw_exception(U_CLASS_ENTRY(spl_ce_InvalidArgumentException), "Unsetting flag CALL_TO_STRING is not possible", 0 TSRMLS_CC);
+               zend_throw_exception(spl_ce_InvalidArgumentException, "Unsetting flag CALL_TO_STRING is not possible", 0 TSRMLS_CC);
                return;
        }
        if ((flags && CIT_FULL_CACHE) != 0 && (intern->u.caching.flags & CIT_FULL_CACHE) == 0) {
@@ -1962,7 +1962,7 @@ static zend_function_entry spl_funcs_CachingIterator[] = {
    Create an iterator from a RecursiveIterator */
 SPL_METHOD(RecursiveCachingIterator, __construct)
 {
-       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(spl_ce_RecursiveIterator), DIT_RecursiveCachingIterator);
+       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, spl_ce_RecursiveIterator, DIT_RecursiveCachingIterator);
 } /* }}} */
 
 /* {{{ proto bolean RecursiveCachingIterator::hasChildren()
@@ -2008,7 +2008,7 @@ static zend_function_entry spl_funcs_RecursiveCachingIterator[] = {
    Create an iterator from anything that is traversable */
 SPL_METHOD(IteratorIterator, __construct)
 {
-       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(zend_ce_traversable), DIT_IteratorIterator);
+       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, zend_ce_traversable, DIT_IteratorIterator);
 } /* }}} */
 
 static
@@ -2031,7 +2031,7 @@ static zend_function_entry spl_funcs_IteratorIterator[] = {
    Create an iterator from another iterator */
 SPL_METHOD(NoRewindIterator, __construct)
 {
-       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(zend_ce_iterator), DIT_NoRewindIterator);
+       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, zend_ce_iterator, DIT_NoRewindIterator);
 } /* }}} */
 
 /* {{{ proto void NoRewindIterator::rewind()
@@ -2123,7 +2123,7 @@ static zend_function_entry spl_funcs_NoRewindIterator[] = {
    Create an iterator from another iterator */
 SPL_METHOD(InfiniteIterator, __construct)
 {
-       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(zend_ce_iterator), DIT_InfiniteIterator);
+       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, zend_ce_iterator, DIT_InfiniteIterator);
 } /* }}} */
 
 /* {{{ proto InfiniteIterator::next()
@@ -2168,14 +2168,14 @@ SPL_METHOD(EmptyIterator, valid)
    Throws exception */
 SPL_METHOD(EmptyIterator, key)
 {
-       zend_throw_exception(U_CLASS_ENTRY(spl_ce_BadMethodCallException), "Accessing the key of an EmptyIterator", 0 TSRMLS_CC);
+       zend_throw_exception(spl_ce_BadMethodCallException, "Accessing the key of an EmptyIterator", 0 TSRMLS_CC);
 } /* }}} */
 
 /* {{{ proto EmptyIterator::current()
    Throws exception */
 SPL_METHOD(EmptyIterator, current)
 {
-       zend_throw_exception(U_CLASS_ENTRY(spl_ce_BadMethodCallException), "Accessing the value of an EmptyIterator", 0 TSRMLS_CC);
+       zend_throw_exception(spl_ce_BadMethodCallException, "Accessing the value of an EmptyIterator", 0 TSRMLS_CC);
 } /* }}} */
 
 /* {{{ proto EmptyIterator::next()
@@ -2246,7 +2246,7 @@ void spl_append_it_next(spl_dual_it_object *intern TSRMLS_DC) /* {{{ */
    Create an AppendIterator */
 SPL_METHOD(AppendIterator, __construct)
 {
-       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, U_CLASS_ENTRY(zend_ce_iterator), DIT_AppendIterator);
+       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, zend_ce_iterator, DIT_AppendIterator);
 } /* }}} */
 
 /* {{{ proto void AppendIterator::append(Iterator it)
@@ -2258,7 +2258,7 @@ SPL_METHOD(AppendIterator, append)
 
        intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &it, U_CLASS_ENTRY(zend_ce_iterator)) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &it, zend_ce_iterator) == FAILURE) {
                return;
        }
        spl_array_iterator_append(intern->u.append.zarrayit, it TSRMLS_CC);
@@ -2362,7 +2362,7 @@ PHP_FUNCTION(iterator_to_array)
        ulong                   int_key;
        int                     key_type;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &obj, U_CLASS_ENTRY(zend_ce_traversable)) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &obj, zend_ce_traversable) == FAILURE) {
                RETURN_FALSE;
        }
        
@@ -2408,7 +2408,7 @@ PHP_FUNCTION(iterator_count)
        zend_object_iterator   *iter;
        long                    count = 0;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &obj, U_CLASS_ENTRY(zend_ce_traversable)) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &obj, zend_ce_traversable) == FAILURE) {
                RETURN_FALSE;
        }
        
index 96e87a15359e5ecb3b5e7e5e2d86013d86f054c6..9c1ba5e2781c21fc0a5c5fbba8ffa9e39cfffb89 100644 (file)
@@ -879,12 +879,12 @@ static zend_object_value sqlite_object_new_exception(zend_class_entry *class_typ
 
 static zend_class_entry *sqlite_get_ce_query(zval *object TSRMLS_DC)
 {
-       return U_CLASS_ENTRY(sqlite_ce_query);
+       return sqlite_ce_query;
 }
 
 static zend_class_entry *sqlite_get_ce_ub_query(zval *object TSRMLS_DC)
 {
-       return U_CLASS_ENTRY(sqlite_ce_ub_query);
+       return sqlite_ce_ub_query;
 }
 
 static zval * sqlite_instanciate(zend_class_entry *pce, zval *object TSRMLS_DC)
@@ -1188,7 +1188,7 @@ static struct php_sqlite_db *php_sqlite_open(char *filename, int mode, char *per
        if (object) {
                /* if object is not an object then we're called from the factory() function */
                if (Z_TYPE_P(object) != IS_OBJECT) {
-                       sqlite_instanciate(U_CLASS_ENTRY(sqlite_ce_db), object TSRMLS_CC);
+                       sqlite_instanciate(sqlite_ce_db, object TSRMLS_CC);
                }
                /* and now register the object */
                SQLITE_REGISTER_OBJECT(db, object, db)
@@ -1295,7 +1295,7 @@ PHP_FUNCTION(sqlite_open)
        zval *errmsg = NULL;
        zval *object = getThis();
 
-       php_set_error_handling(object ? EH_THROW : EH_NORMAL, U_CLASS_ENTRY(sqlite_ce_exception) TSRMLS_CC);
+       php_set_error_handling(object ? EH_THROW : EH_NORMAL, sqlite_ce_exception TSRMLS_CC);
        if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz/",
                                &filename, &filename_len, &mode, &errmsg)) {
                php_std_error_handling();
@@ -1350,7 +1350,7 @@ PHP_FUNCTION(sqlite_factory)
        int filename_len;
        zval *errmsg = NULL;
 
-       php_set_error_handling(EH_THROW, U_CLASS_ENTRY(sqlite_ce_exception) TSRMLS_CC);
+       php_set_error_handling(EH_THROW, sqlite_ce_exception TSRMLS_CC);
        if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz/",
                                &filename, &filename_len, &mode, &errmsg)) {
                php_std_error_handling();
@@ -1577,9 +1577,9 @@ terminate:
        if (object) {
                sqlite_object *obj;
                if (buffered) {
-                       sqlite_instanciate(U_CLASS_ENTRY(sqlite_ce_query), return_value TSRMLS_CC);
+                       sqlite_instanciate(sqlite_ce_query, return_value TSRMLS_CC);
                } else {
-                       sqlite_instanciate(U_CLASS_ENTRY(sqlite_ce_ub_query), return_value TSRMLS_CC);
+                       sqlite_instanciate(sqlite_ce_ub_query, return_value TSRMLS_CC);
                }
                obj = (sqlite_object *) zend_object_store_get_object(return_value TSRMLS_CC);
                obj->type = is_result;
@@ -2073,7 +2073,7 @@ PHP_FUNCTION(sqlite_fetch_object)
        zval *ctor_params = NULL;
        zend_uchar class_name_type;
 
-       php_set_error_handling(object ? EH_THROW : EH_NORMAL, U_CLASS_ENTRY(sqlite_ce_exception) TSRMLS_CC);
+       php_set_error_handling(object ? EH_THROW : EH_NORMAL, sqlite_ce_exception TSRMLS_CC);
        if (object) {
                if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|tzb", &class_name, &class_name_len, &class_name_type, &ctor_params, &decode_binary)) {
                        php_std_error_handling();
@@ -2081,7 +2081,7 @@ PHP_FUNCTION(sqlite_fetch_object)
                }
                RES_FROM_OBJECT(res, object);
                if (!ZEND_NUM_ARGS()) {
-                       ce = U_CLASS_ENTRY(zend_standard_class_def);
+                       ce = zend_standard_class_def;
                } else {
                        ce = zend_u_fetch_class(class_name_type, class_name, class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
                }
@@ -2092,14 +2092,14 @@ PHP_FUNCTION(sqlite_fetch_object)
                }
                ZEND_FETCH_RESOURCE(res, struct php_sqlite_result *, &zres, -1, "sqlite result", le_sqlite_result);
                if (ZEND_NUM_ARGS() < 2) {
-                       ce = U_CLASS_ENTRY(zend_standard_class_def);
+                       ce = zend_standard_class_def;
                } else {
                        ce = zend_u_fetch_class(class_name_type, class_name, class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
                }
        }
 
        if (!ce) {
-               zend_throw_exception_ex(U_CLASS_ENTRY(sqlite_ce_exception), 0 TSRMLS_CC, "Could not find class '%s'", class_name);
+               zend_throw_exception_ex(sqlite_ce_exception, 0 TSRMLS_CC, "Could not find class '%s'", class_name);
                php_std_error_handling();
                return;
        }
@@ -2142,7 +2142,7 @@ PHP_FUNCTION(sqlite_fetch_object)
                                 * single value is an array. Also we'd have to make that one
                                 * argument passed by reference.
                                 */
-                               zend_throw_exception(U_CLASS_ENTRY(sqlite_ce_exception), "Parameter ctor_params must be an array", 0 TSRMLS_CC);
+                               zend_throw_exception(sqlite_ce_exception, "Parameter ctor_params must be an array", 0 TSRMLS_CC);
                                return;
                        }
                } else {
@@ -2157,7 +2157,7 @@ PHP_FUNCTION(sqlite_fetch_object)
                fcc.object_pp = &return_value;
 
                if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
-                       zend_throw_exception_ex(U_CLASS_ENTRY(sqlite_ce_exception), 0 TSRMLS_CC, "Could not execute %s::%v()", class_name, ce->constructor->common.function_name);
+                       zend_throw_exception_ex(sqlite_ce_exception, 0 TSRMLS_CC, "Could not execute %s::%v()", class_name, ce->constructor->common.function_name);
                } else {
                        if (retval_ptr) {
                                zval_ptr_dtor(&retval_ptr);
@@ -2167,7 +2167,7 @@ PHP_FUNCTION(sqlite_fetch_object)
                        efree(fci.params);
                }
        } else if (ctor_params && Z_TYPE_P(ctor_params) != IS_NULL) {
-               zend_throw_exception_ex(U_CLASS_ENTRY(sqlite_ce_exception), 0 TSRMLS_CC, "Class %s does not have a constructor, use NULL for parameter ctor_params or omit it", class_name);
+               zend_throw_exception_ex(sqlite_ce_exception, 0 TSRMLS_CC, "Class %s does not have a constructor, use NULL for parameter ctor_params or omit it", class_name);
        }
 }
 /* }}} */
@@ -2545,7 +2545,7 @@ static int sqlite_count_elements(zval *object, long *count TSRMLS_DC) /* {{{ */
                * count = obj->u.res->nrows;
                return SUCCESS;
        } else {
-               zend_throw_exception(U_CLASS_ENTRY(sqlite_ce_exception), "Row count is not available for unbuffered queries", 0 TSRMLS_CC);
+               zend_throw_exception(sqlite_ce_exception, "Row count is not available for unbuffered queries", 0 TSRMLS_CC);
                return FAILURE;
        }
 } /* }}} */
index 314897a38606b150054f41993e4806bbe7acb1b9..ee1980b71798f21cfedfa6ed473aefec6e06a7f2 100644 (file)
@@ -316,7 +316,7 @@ PHP_FUNCTION(count)
                        /* it the object implements Countable we call its count() method */
                        zval *retval;
 
-                       if (Z_OBJ_HT_P(array)->get_class_entry && instanceof_function(Z_OBJCE_P(array), U_CLASS_ENTRY(spl_ce_Countable) TSRMLS_CC)) {
+                       if (Z_OBJ_HT_P(array)->get_class_entry && instanceof_function(Z_OBJCE_P(array), spl_ce_Countable TSRMLS_CC)) {
                                zend_call_method_with_0_params(&array, NULL, NULL, "count", &retval);
                                RETVAL_LONG(Z_LVAL_P(retval));
                                zval_ptr_dtor(&retval);
index 3495de67e8bb4f79ee9e0b6e8c49d9a849511b4a..36ab84fdc36e02a3df36584ecf93eca70d6fcf96 100644 (file)
@@ -201,7 +201,7 @@ static void _php_do_opendir(INTERNAL_FUNCTION_PARAMETERS, int createobject)
        php_set_default_dir(dirp->rsrc_id TSRMLS_CC);
 
        if (createobject) {
-               object_init_ex(return_value, U_CLASS_ENTRY(dir_class_entry_ptr));
+               object_init_ex(return_value, dir_class_entry_ptr);
                add_property_rt_stringl(return_value, "path", dirname, dir_len, 1);
                add_property_resource(return_value, "handle", dirp->rsrc_id);
                php_stream_auto_cleanup(dirp); /* so we don't get warnings under debug */
index 47dc7f7e1d00ab7587f9dd70f5f18ff44a5c45a2..5fee51fc058f29d574fc5b1541ba0f2780b82acb 100644 (file)
@@ -539,7 +539,7 @@ PHP_METHOD(TextIterator, __construct)
                intern->flags = flags;
        }
 
-       if (Z_OBJCE_P(this_ptr) == U_CLASS_ENTRY(rev_text_iterator_ce)) {
+       if (Z_OBJCE_P(this_ptr) == rev_text_iterator_ce) {
                intern->flags |= ITER_REVERSE;
        }
 
index facdbc0acc5b69425a472c4636374b60ad824603..fa59cf808ca459c411c8f25a2fa16b3ac2f77338 100644 (file)
@@ -75,6 +75,7 @@ SAPI_API sapi_module_struct sapi_module;
 
 SAPI_API void sapi_startup(sapi_module_struct *sf)
 {
+       sf->ini_entries = NULL;
        sapi_module = *sf;
 
 #ifdef ZTS
index 4998f7857b2cca0d7eaf32bef902ed0f8d35a864..9abf29b0fc61c61fd95a1b8e701b87074ef3c9d7 100644 (file)
@@ -258,6 +258,8 @@ struct _sapi_module_struct {
        
        void (*ini_defaults)(HashTable *configuration_hash);
        int phpinfo_as_text;
+
+       char *ini_entries;
 };
 
 
index 05b3bba5539fb89272d79ac98efc7500c3009263..b52ce72ee1e5f5cf0344d0327c5ec26a9e1457b1 100644 (file)
@@ -524,6 +524,11 @@ int php_init_config(TSRMLS_D)
                        zend_llist_destroy(&scanned_ini_list);
                }
        }
+
+       if (sapi_module.ini_entries) {
+               zend_parse_ini_string(sapi_module.ini_entries, 1, php_config_ini_parser_cb, &extension_lists);
+       }
+       
        return SUCCESS;
 }
 /* }}} */
index f59be9d86bb10d27241b0a5050bc8a82f8865ece..5d0ffa56d1dc605a7e2eda8c85467c0be50484c8 100644 (file)
@@ -581,6 +581,7 @@ SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data)
                                        php_register_variable_safe(var, val, new_val_len, array_ptr TSRMLS_CC);
                                }
                                */
+                               efree(u_var);
                                efree(u_val);
                        }
                } else {
@@ -696,15 +697,11 @@ static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC)
                        }
                        /* auto-type */
                        ALLOC_ZVAL(tmp);
-                       Z_TYPE_P(tmp) = IS_STRING;
-                       Z_STRLEN_P(tmp) = strlen(ss);
-                       Z_STRVAL_P(tmp) = estrndup(ss, Z_STRLEN_P(tmp));
+                       ZVAL_RT_STRING(tmp, ss, 1);
                        INIT_PZVAL(tmp);
                        count++;
                        if (zend_hash_next_index_insert(Z_ARRVAL_P(arr), &tmp, sizeof(zval *), NULL) == FAILURE) {
-                               if (Z_TYPE_P(tmp) == IS_STRING) {
-                                       efree(Z_STRVAL_P(tmp));
-                               }
+                               efree(Z_STRVAL_P(tmp));
                        }
                        if (space) {
                                *space = '+';
index d55c84c5fddcc327cd75d170b03dc95bffefabad..cbba5c873f183ccabc7bd8838e1ff4eff79fd265 100644 (file)
@@ -846,22 +846,6 @@ static void init_request_info(TSRMLS_D)
 }
 /* }}} */
 
-static void define_command_line_ini_entry(char *arg)
-{
-       char *name, *value;
-
-       name = arg;
-       value = strchr(arg, '=');
-       if (value) {
-               *value = 0;
-               value++;
-       } else {
-               value = "1";
-       }
-       zend_alter_ini_entry(name, strlen(name) + 1, value, strlen(value), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);
-}
-
-
 static void php_register_command_line_global_vars(char **arg TSRMLS_DC)
 {
        char *var, *val;
@@ -913,6 +897,7 @@ int main(int argc, char *argv[])
        char *orig_optarg = php_optarg;
        char *script_file = NULL;
        zend_llist global_vars;
+       int ini_entries_len = 0;
 
 /* end of temporary locals */
 #ifdef ZTS
@@ -995,6 +980,23 @@ int main(int argc, char *argv[])
                        /* if we're started on command line, check to see if
                           we are being started as an 'external' fastcgi
                           server by accepting a bindpath parameter. */
+                       case 'd': { 
+                               /* define ini entries on command line */
+                               int len = strlen(php_optarg);
+
+                               if (strchr(php_optarg, '=')) {
+                                       cgi_sapi_module.ini_entries = realloc(cgi_sapi_module.ini_entries, ini_entries_len + len + sizeof("\n\0"));
+                                       memcpy(cgi_sapi_module.ini_entries + ini_entries_len, php_optarg, len);
+                                       memcpy(cgi_sapi_module.ini_entries + ini_entries_len + len, "\n\0", sizeof("\n\0"));
+                                       ini_entries_len += len + sizeof("\n\0") - 2;
+                               } else {
+                                       cgi_sapi_module.ini_entries = realloc(cgi_sapi_module.ini_entries, ini_entries_len + len + sizeof("=1\n\0"));
+                                       memcpy(cgi_sapi_module.ini_entries + ini_entries_len, php_optarg, len);
+                                       memcpy(cgi_sapi_module.ini_entries + ini_entries_len + len, "=1\n\0", sizeof("=1\n\0"));
+                                       ini_entries_len += len + sizeof("=1\n\0") - 2;
+                               }
+                               break;
+                       }
                        case 'b':
                                if (!fastcgi) {
                                        bindpath = strdup(php_optarg);
@@ -1270,9 +1272,6 @@ consult the installation file that came with this distribution, or visit \n\
                                                case 'C': /* don't chdir to the script directory */
                                                        SG(options) |= SAPI_OPTION_NO_CHDIR;
                                                        break;
-                                               case 'd': /* define ini entries on command line */
-                                                       define_command_line_ini_entry(php_optarg);
-                                                       break;
 
                                        case 'e': /* enable extended info output */
                                                        CG(extended_info) = 1;
@@ -1586,6 +1585,9 @@ fastcgi_request_done:
                if (cgi_sapi_module.php_ini_path_override) {
                        free(cgi_sapi_module.php_ini_path_override);
                }
+               if (cgi_sapi_module.ini_entries) {
+                       free(cgi_sapi_module.ini_entries);
+               }
        } zend_catch {
                exit_status = 255;
        } zend_end_try();
@@ -1595,7 +1597,7 @@ fastcgi_request_done:
        sapi_shutdown();
 
 #ifdef ZTS
-       /*tsrm_shutdown();*/
+       tsrm_shutdown();
 #endif
 
 #if defined(PHP_WIN32) && ZEND_DEBUG && 0
index dda36aa3c4de9385c28b91bb203493ee3696dc9b..fa22d26ae7a7cc76da1fea495c522e7ef1e59738 100644 (file)
 #define PHP_MODE_REFLECTION_CLASS       9
 #define PHP_MODE_REFLECTION_EXTENSION   10
 
+#define HARDCODED_INI                  \
+       "html_errors=0\n"                       \
+       "register_argc_argv=1\n"        \
+       "implicit_flush=1\n"            \
+       "output_buffering=0\n"          \
+       "max_execution_time=0\n"
+
+
 static char *php_optarg = NULL;
 static int php_optind = 1;
 #if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
@@ -335,10 +343,6 @@ static int php_cli_startup(sapi_module_struct *sapi_module)
        zend_hash_update(configuration_hash, name, sizeof(name), tmp, sizeof(zval), (void**)&entry);\
        Z_STRVAL_P(entry) = zend_strndup(Z_STRVAL_P(entry), Z_STRLEN_P(entry))
 
-/* hard coded ini settings must be set in main() */
-#define INI_HARDCODED(name,value)\
-               zend_alter_ini_entry(name, sizeof(name), value, strlen(value), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);
-
 static void sapi_cli_ini_defaults(HashTable *configuration_hash)
 {
        zval *tmp, *entry;
@@ -442,29 +446,6 @@ static void php_cli_usage(char *argv0)
 }
 /* }}} */
 
-static void define_command_line_ini_entry(char *arg TSRMLS_DC)
-{
-       char *name, *value;
-
-       name = arg;
-       value = strchr(arg, '=');
-       if (value) {
-               *value = 0;
-               value++;
-       } else {
-               value = "1";
-       }
-
-       if (!strcasecmp(name, "extension")) { /* load function module */
-               zval extension, zval;
-               ZVAL_STRING(&extension, value, 0);
-               php_dl(&extension, MODULE_PERSISTENT, &zval, 1 TSRMLS_CC);
-       } else {
-               zend_alter_ini_entry(name, strlen(name)+1, value, strlen(value), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);
-       }
-}
-
-
 static void php_register_command_line_global_vars(char **arg TSRMLS_DC)
 {
        char *var, *val;
@@ -608,6 +589,7 @@ int main(int argc, char *argv[])
        int argc = __argc;
        char **argv = __argv;
 #endif
+       int ini_entries_len = 0;
 
 #if defined(PHP_WIN32) && defined(_DEBUG) && defined(PHP_WIN32_DEBUG_HEAP)
        {
@@ -651,15 +633,36 @@ int main(int argc, char *argv[])
        setmode(_fileno(stderr), O_BINARY);             /* make the stdio mode be binary */
 #endif
 
+       ini_entries_len = strlen(HARDCODED_INI);
+       cli_sapi_module.ini_entries = malloc(ini_entries_len+2);
+       memcpy(cli_sapi_module.ini_entries, HARDCODED_INI, ini_entries_len+1);
+       cli_sapi_module.ini_entries[ini_entries_len+1] = 0;
 
        while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0))!=-1) {
                switch (c) {
-               case 'c':
-                       cli_sapi_module.php_ini_path_override = strdup(php_optarg);
-                       break;
-               case 'n':
-                       cli_sapi_module.php_ini_ignore = 1;
-                       break;
+                       case 'c':
+                               cli_sapi_module.php_ini_path_override = strdup(php_optarg);
+                               break;
+                       case 'n':
+                               cli_sapi_module.php_ini_ignore = 1;
+                               break;
+                       case 'd': {
+                               /* define ini entries on command line */
+                               int len = strlen(php_optarg);
+
+                               if (strchr(php_optarg, '=')) {
+                                       cli_sapi_module.ini_entries = realloc(cli_sapi_module.ini_entries, ini_entries_len + len + sizeof("\n\0"));
+                                       memcpy(cli_sapi_module.ini_entries + ini_entries_len, php_optarg, len);
+                                       memcpy(cli_sapi_module.ini_entries + ini_entries_len + len, "\n\0", sizeof("\n\0"));
+                                       ini_entries_len += len + sizeof("\n\0") - 2;
+                               } else {
+                                       cli_sapi_module.ini_entries = realloc(cli_sapi_module.ini_entries, ini_entries_len + len + sizeof("=1\n\0"));
+                                       memcpy(cli_sapi_module.ini_entries + ini_entries_len, php_optarg, len);
+                                       memcpy(cli_sapi_module.ini_entries + ini_entries_len + len, "=1\n\0", sizeof("=1\n\0"));
+                                       ini_entries_len += len + sizeof("=1\n\0") - 2;
+                               }
+                               break;
+                       }
                }
        }
        php_optind = orig_optind;
@@ -690,7 +693,6 @@ int main(int argc, char *argv[])
        zend_first_try {
                zend_llist_init(&global_vars, sizeof(char *), NULL, 0);
 
-               zend_uv.html_errors = 0; /* tell the engine we're in non-html mode */
                CG(in_compilation) = 0; /* not initialized but needed for several options */
                EG(uninitialized_zval_ptr) = NULL;
 
@@ -700,20 +702,9 @@ int main(int argc, char *argv[])
                        goto out_err;
                }
 
-               /* here is the place for hard coded defaults which cannot be overwritten in the ini file */
-               INI_HARDCODED("register_argc_argv", "1");
-               INI_HARDCODED("html_errors", "0");
-               INI_HARDCODED("implicit_flush", "1");
-               INI_HARDCODED("output_buffering", "0");
-               INI_HARDCODED("max_execution_time", "0");
-
                while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0)) != -1) {
                        switch (c) {
 
-                       case 'd': /* define ini entries on command line */
-                               define_command_line_ini_entry(php_optarg TSRMLS_CC);
-                               break;
-
                        case 'h': /* help & quit */
                        case '?':
                                if (php_request_startup(TSRMLS_C)==FAILURE) {
@@ -1237,6 +1228,9 @@ int main(int argc, char *argv[])
                if (cli_sapi_module.php_ini_path_override) {
                        free(cli_sapi_module.php_ini_path_override);
                }
+               if (cli_sapi_module.ini_entries) {
+                       free(cli_sapi_module.ini_entries);
+               }
        } zend_end_try();
 
 out:
@@ -1253,7 +1247,7 @@ out_err:
        tsrm_shutdown();
 #endif
 
-       exit(exit_status);
+       return exit_status;
 
 err:
        zend_ini_deactivate(TSRMLS_C);
index e33580ab0def9b158590f2a7a2b8fda1af49e8b7..2f572df073e0f081fcc0b99061967df5d61aff99 100755 (executable)
@@ -20,3 +20,13 @@ array(1) {
   }
 }
 Done
+--UEXPECT--
+array(1) {
+  [123]=>
+  array(1) {
+    [0]=>
+    unicode(4) "SEGV"
+  }
+}
+Done
+
index 8bf1f7b252b9989d6d0a7189d7ddf1748dc31766..4742ea36fda41e707c542b98890903cb7573ca32 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 INI section allows '='
 --INI--
-arg_separator.input==
+arg_separator.input="="
 --FILE--
 <?php
 var_dump(ini_get('arg_separator.input'));
@@ -9,4 +9,4 @@ var_dump(ini_get('arg_separator.input'));
 --EXPECT--
 string(1) "="
 --UEXPECT--
-unicode(1) "="
\ No newline at end of file
+unicode(1) "="