]> granicus.if.org Git - php/commitdiff
Fix registering/derigistering of stdClass in ZTS and NON ZTS mode
authorMarcus Boerger <helly@php.net>
Mon, 8 Sep 2003 10:45:19 +0000 (10:45 +0000)
committerMarcus Boerger <helly@php.net>
Mon, 8 Sep 2003 10:45:19 +0000 (10:45 +0000)
Zend/zend.c
tests/classes/class_stdclass.phpt [new file with mode: 0755]

index fff8b7d1f06247c1c98011306dac9aeccf5e2719..d63359c4f3a6b1cf1fdac86e1f97e88497a93613 100644 (file)
@@ -401,16 +401,9 @@ static void register_standard_class(TSRMLS_D)
        zend_standard_class_def->name = zend_strndup("stdClass", zend_standard_class_def->name_length);
        zend_initialize_class_data(zend_standard_class_def, 1 TSRMLS_CC);
 
-       zend_hash_add(GLOBAL_CLASS_TABLE, "stdclass", sizeof("stdclass")-1, &zend_standard_class_def, sizeof(zend_class_entry *), NULL);
+       zend_hash_add(CG(class_table), "stdclass", sizeof("stdclass"), &zend_standard_class_def, sizeof(zend_class_entry *), NULL);
 }
 
-#ifdef ZTS
-static void unregister_standard_class()
-{
-       destroy_zend_class(&zend_standard_class_def);
-}
-#endif
-
 static void zend_set_default_compile_time_values(TSRMLS_D)
 {
        /* default compile-time values */
@@ -697,7 +690,6 @@ void zend_shutdown(TSRMLS_D)
        zend_shutdown_constants(TSRMLS_C);
 #ifdef ZTS
        zend_hash_destroy(GLOBAL_CONSTANTS_TABLE);
-       unregister_standard_class();
 #endif
 }
 
diff --git a/tests/classes/class_stdclass.phpt b/tests/classes/class_stdclass.phpt
new file mode 100755 (executable)
index 0000000..5e3422a
--- /dev/null
@@ -0,0 +1,14 @@
+--TEST--
+Instantiate stdClass
+--FILE--
+<?php
+
+$obj = new stdClass;
+
+echo get_class($obj)."\n";
+
+echo "Done\n";
+?>
+--EXPECTF--
+stdClass
+Done