File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -131,8 +131,10 @@ static void _php_cal_info(int cal, zval *ret)
131131 calendar = & cal_conversion_table [cal ];
132132 array_init (ret );
133133
134- array_init (& months );
135- array_init (& smonths );
134+ array_init_size (& months , calendar -> num_months + 1 );
135+ array_init_size (& smonths , calendar -> num_months + 1 );
136+ zend_hash_real_init_packed (Z_ARRVAL (months ));
137+ zend_hash_real_init_packed (Z_ARRVAL (smonths ));
136138
137139 for (i = 1 ; i <= calendar -> num_months ; i ++ ) {
138140 add_index_string (& months , i , calendar -> month_name_long [i ]);
@@ -160,7 +162,8 @@ PHP_FUNCTION(cal_info)
160162 int i ;
161163 zval val ;
162164
163- array_init (return_value );
165+ array_init_size (return_value , CAL_NUM_CALS );
166+ zend_hash_real_init_packed (Z_ARRVAL_P (return_value ));
164167
165168 for (i = 0 ; i < CAL_NUM_CALS ; i ++ ) {
166169 _php_cal_info (i , & val );
You can’t perform that action at this time.
0 commit comments