From: Frank M. Kromann Date: Sun, 4 Mar 2001 02:41:27 +0000 (+0000) Subject: Changed code layout to remove PHP warning when running php as a CGI. X-Git-Tag: php-4.0.5RC1~92 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f6f67ffd62bc9b21b168c16c594c0ab4010f7ce3;p=php Changed code layout to remove PHP warning when running php as a CGI. --- diff --git a/ext/standard/info.c b/ext/standard/info.c index 12a5dc39ba..9d5fe50cb0 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -60,7 +60,7 @@ static int _display_module_info(zend_module_entry *module, void *arg) static void php_print_gpcse_array(char *name, uint name_length ELS_DC) { - zval **data, **tmp; + zval **data, **tmp, *tmp2; char *string_key; ulong num_key; @@ -68,16 +68,7 @@ static void php_print_gpcse_array(char *name, uint name_length ELS_DC) && ((*data)->type==IS_ARRAY)) { zend_hash_internal_pointer_reset((*data)->value.ht); while (zend_hash_get_current_data((*data)->value.ht, (void **) &tmp) == SUCCESS) { - zval tmp2, *value_ptr; - if ((*tmp)->type != IS_STRING) { - tmp2 = **tmp; - zval_copy_ctor(&tmp2); - convert_to_string(&tmp2); - value_ptr = &tmp2; - } else { - value_ptr = *tmp; - } PUTS(""); PUTS(""); PUTS(name); @@ -95,14 +86,17 @@ static void php_print_gpcse_array(char *name, uint name_length ELS_DC) PUTS("
");
 				zend_print_zval_r(*tmp, 0);
 				PUTS("
"); + } else if ((*tmp)->type != IS_STRING) { + tmp2 = *tmp; + zval_copy_ctor(tmp2); + convert_to_string(tmp2); + PUTS(tmp2->value.str.val); + zval_dtor(tmp2); } else { - PUTS(value_ptr->value.str.val); + PUTS((*tmp)->value.str.val); } PUTS("\n"); zend_hash_move_forward((*data)->value.ht); - if (value_ptr==&tmp2) { - zval_dtor(value_ptr); - } } } }