]> granicus.if.org Git - php/commitdiff
@- Fixed shuffle() so that it no longer breaks on Solaris. (Andrei)
authorAndrei Zmievski <andrei@php.net>
Fri, 15 Oct 1999 19:25:27 +0000 (19:25 +0000)
committerAndrei Zmievski <andrei@php.net>
Fri, 15 Oct 1999 19:25:27 +0000 (19:25 +0000)
ext/standard/basic_functions.c
ext/standard/basic_functions.h

index 978512bd8b728cf63f739f96e5b6e68c3876554c..3c4cd3122ca9f192d881d40f1e5aa0e064e5cac5 100644 (file)
@@ -335,6 +335,7 @@ function_entry basic_functions[] = {
        PHP_FE(array_values,                            NULL)
        PHP_FE(array_count_values,                      NULL)
        PHP_FE(array_reverse,                           NULL)
+       PHP_FE(array_map,                                       NULL)
 
        PHP_FE(connection_aborted,                      NULL)
        PHP_FE(connection_timeout,                      NULL)
@@ -2457,7 +2458,7 @@ PHP_FUNCTION(shuffle)
                php_error(E_WARNING, "Wrong datatype in shuffle() call");
                return;
        }
-       if (zend_hash_sort((*array)->value.ht, qsort, array_data_shuffle, 1) == FAILURE) {
+       if (zend_hash_sort((*array)->value.ht, mergesort, array_data_shuffle, 1) == FAILURE) {
                return;
        }
        RETURN_TRUE;
@@ -3141,6 +3142,22 @@ PHP_FUNCTION(array_reverse)
 }
 /* }}} */
 
+/* {{{ proto array array_map(array input, string value_exp [, string key_exp] */
+PHP_FUNCTION(array_map)
+{
+       zval            **input;
+       zval            **value_exp;
+       zval            **key_exp = NULL;
+       int                       argc;
+       
+       argc = ARG_COUNT(ht);
+       
+       if (argc < 2 || argc > 3 || getParametersEx(ht, &input, &value_exp, &key_exp) == FAILURE) {
+               WRONG_PARAM_COUNT;
+       }
+}
+
+
 /*
  * Local variables:
  * tab-width: 4
index 3b266a99e0e759a42adbb294f95dc5cb16680037..78a499d2fb6e8d3c5103389730ded10899707d8f 100644 (file)
@@ -137,6 +137,7 @@ PHP_FUNCTION(array_keys);
 PHP_FUNCTION(array_values);
 PHP_FUNCTION(array_count_values);
 PHP_FUNCTION(array_reverse);
+PHP_FUNCTION(array_map);
 
 #if HAVE_PUTENV
 typedef struct {