@@ -1297,13 +1297,12 @@ PHP_FUNCTION(min)
1297
1297
1298
1298
/* mixed min ( array $values ) */
1299
1299
if (argc == 1 ) {
1300
- zval * result ;
1301
-
1302
1300
if (Z_TYPE (args [0 ]) != IS_ARRAY ) {
1303
1301
zend_argument_type_error (1 , "must be of type array, %s given" , zend_zval_type_name (& args [0 ]));
1304
1302
RETURN_THROWS ();
1305
1303
} else {
1306
- if ((result = zend_hash_minmax (Z_ARRVAL (args [0 ]), php_array_data_compare , 0 )) != NULL ) {
1304
+ zval * result = zend_hash_minmax (Z_ARRVAL (args [0 ]), php_array_data_compare_unstable , 0 );
1305
+ if (result ) {
1307
1306
ZVAL_COPY_DEREF (return_value , result );
1308
1307
} else {
1309
1308
zend_argument_value_error (1 , "must contain at least one element" );
@@ -1344,13 +1343,12 @@ PHP_FUNCTION(max)
1344
1343
1345
1344
/* mixed max ( array $values ) */
1346
1345
if (argc == 1 ) {
1347
- zval * result ;
1348
-
1349
1346
if (Z_TYPE (args [0 ]) != IS_ARRAY ) {
1350
1347
zend_argument_type_error (1 , "must be of type array, %s given" , zend_zval_type_name (& args [0 ]));
1351
1348
RETURN_THROWS ();
1352
1349
} else {
1353
- if ((result = zend_hash_minmax (Z_ARRVAL (args [0 ]), php_array_data_compare , 1 )) != NULL ) {
1350
+ zval * result = zend_hash_minmax (Z_ARRVAL (args [0 ]), php_array_data_compare_unstable , 1 );
1351
+ if (result ) {
1354
1352
ZVAL_COPY_DEREF (return_value , result );
1355
1353
} else {
1356
1354
zend_argument_value_error (1 , "must contain at least one element" );
0 commit comments