]> granicus.if.org Git - php/commitdiff
Fixed bug #47549 (get_defined_constants() return array with broken
authorIlia Alshanetsky <iliaa@php.net>
Tue, 3 Mar 2009 23:42:51 +0000 (23:42 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 3 Mar 2009 23:42:51 +0000 (23:42 +0000)
array categories)

Zend/zend_builtin_functions.c

index 72ec836cb36453d57a0b63a2d5dd15c8ed72a597..f7d0dc99605355b700328db0c197a1fcbe4cfbb2 100644 (file)
@@ -1814,7 +1814,8 @@ ZEND_FUNCTION(get_defined_constants)
                module_names[0] = "internal";
                zend_hash_internal_pointer_reset_ex(&module_registry, &pos);
                while (zend_hash_get_current_data_ex(&module_registry, (void *) &module, &pos) != FAILURE) {
-                       module_names[i++] = (char*)module->name;
+                       module_names[module->module_number] = (char *)module->name;
+                       i++;
                        zend_hash_move_forward_ex(&module_registry, &pos);
                }
                module_names[i] = "user";