andrei          Fri Jul 14 18:12:45 2006 UTC

  Modified files:              
    /php-src    unicode-progress.txt 
    /php-src/ext/standard       array.c 
  Log:
  Update end(), prev(), next(), reset(), current(), and key() for params
  API and mark with U.
  
  
http://cvs.php.net/viewvc.cgi/php-src/unicode-progress.txt?r1=1.19&r2=1.20&diff_format=u
Index: php-src/unicode-progress.txt
diff -u php-src/unicode-progress.txt:1.19 php-src/unicode-progress.txt:1.20
--- php-src/unicode-progress.txt:1.19   Fri Jul 14 18:03:13 2006
+++ php-src/unicode-progress.txt        Fri Jul 14 18:12:45 2006
@@ -70,9 +70,6 @@
     array_walk_recursive()
         Params API, is_callable check, FCI cache, test
 
-    end(), prev(), next(), reset(), current(), key()
-        Params API, test
-
     extract()
         Params API, fix php_valid_var_name(), test
 
@@ -108,6 +105,8 @@
     range()
     shuffle()
 
+    end(), prev(), next(), reset(), current(), key()
+
     sort(), rsort()
     asort(), arsort()
     ksort(), krsort() 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.357&r2=1.358&diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.357 php-src/ext/standard/array.c:1.358
--- php-src/ext/standard/array.c:1.357  Fri Jul 14 18:03:13 2006
+++ php-src/ext/standard/array.c        Fri Jul 14 18:12:45 2006
@@ -21,7 +21,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: array.c,v 1.357 2006/07/14 18:03:13 andrei Exp $ */
+/* $Id: array.c,v 1.358 2006/07/14 18:12:45 andrei Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -791,21 +791,18 @@
 }
 /* }}} */
 
-/* {{{ proto mixed end(array array_arg)
+/* {{{ proto mixed end(array array_arg) U
    Advances array argument's internal pointer to the last element and return 
it */
 PHP_FUNCTION(end)
 {
-       zval **array, **entry;
+       zval *array, **entry;
        HashTable *target_hash;
 
-       if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &array) == 
FAILURE) {
-               WRONG_PARAM_COUNT;
-       }
-       target_hash = HASH_OF(*array);
-       if (!target_hash) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passed variable is 
not an array or object");
-               RETURN_FALSE;
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == 
FAILURE) {
+               return;
        }
+
+       target_hash = HASH_OF(array);
        zend_hash_internal_pointer_end(target_hash);
 
        if (return_value_used) {        
@@ -818,21 +815,18 @@
 }
 /* }}} */
 
-/* {{{ proto mixed prev(array array_arg)
+/* {{{ proto mixed prev(array array_arg) U
    Move array argument's internal pointer to the previous element and return 
it */
 PHP_FUNCTION(prev)
 {
-       zval **array, **entry;
+       zval *array, **entry;
        HashTable *target_hash;
 
-       if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &array) == 
FAILURE) {
-               WRONG_PARAM_COUNT;
-       }
-       target_hash = HASH_OF(*array);
-       if (!target_hash) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passed variable is 
not an array or object");
-               RETURN_FALSE;
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == 
FAILURE) {
+               return;
        }
+
+       target_hash = HASH_OF(array);
        zend_hash_move_backwards(target_hash);
 
        if (return_value_used) {        
@@ -845,21 +839,18 @@
 }
 /* }}} */
 
-/* {{{ proto mixed next(array array_arg)
+/* {{{ proto mixed next(array array_arg) U
    Move array argument's internal pointer to the next element and return it */
 PHP_FUNCTION(next)
 {
-       zval **array, **entry;
+       zval *array, **entry;
        HashTable *target_hash;
 
-       if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &array) == 
FAILURE) {
-               WRONG_PARAM_COUNT;
-       }
-       target_hash = HASH_OF(*array);
-       if (!target_hash) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passed variable is 
not an array or object");
-               RETURN_FALSE;
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == 
FAILURE) {
+               return;
        }
+
+       target_hash = HASH_OF(array);
        zend_hash_move_forward(target_hash);
 
        if (return_value_used) {
@@ -872,21 +863,18 @@
 }
 /* }}} */
 
-/* {{{ proto mixed reset(array array_arg)
+/* {{{ proto mixed reset(array array_arg) U
    Set array argument's internal pointer to the first element and return it */ 
 PHP_FUNCTION(reset)
 {
-       zval **array, **entry;
+       zval *array, **entry;
        HashTable *target_hash;
 
-       if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &array) == 
FAILURE) {
-               WRONG_PARAM_COUNT;
-       }
-       target_hash = HASH_OF(*array);
-       if (!target_hash) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passed variable is 
not an array or object");
-               RETURN_FALSE;
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == 
FAILURE) {
+               return;
        }
+
+       target_hash = HASH_OF(array);
        zend_hash_internal_pointer_reset(target_hash);
 
        if (return_value_used) {        
@@ -899,21 +887,18 @@
 }
 /* }}} */
 
-/* {{{ proto mixed current(array array_arg)
+/* {{{ proto mixed current(array array_arg) U
    Return the element currently pointed to by the internal array pointer */
 PHP_FUNCTION(current)
 {
-       zval **array, **entry;
+       zval *array, **entry;
        HashTable *target_hash;
 
-       if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &array) == 
FAILURE) {
-               WRONG_PARAM_COUNT;
-       }
-       target_hash = HASH_OF(*array);
-       if (!target_hash) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passed variable is 
not an array or object");
-               RETURN_FALSE;
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == 
FAILURE) {
+               return;
        }
+
+       target_hash = HASH_OF(array);
        if (zend_hash_get_current_data(target_hash, (void **) &entry) == 
FAILURE) {
                RETURN_FALSE;
        }
@@ -921,24 +906,21 @@
 }
 /* }}} */
 
-/* {{{ proto mixed key(array array_arg)
+/* {{{ proto mixed key(array array_arg) U
    Return the key of the element currently pointed to by the internal array 
pointer */
 PHP_FUNCTION(key)
 {
-       zval **array;
+       zval *array;
        zstr string_key;
        uint string_length;
        ulong num_key;
        HashTable *target_hash;
 
-       if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &array) == 
FAILURE) {
-               WRONG_PARAM_COUNT;
-       }
-       target_hash = HASH_OF(*array);
-       if (!target_hash) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passed variable is 
not an array or object");
-               RETURN_FALSE;
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == 
FAILURE) {
+               return;
        }
+
+       target_hash = HASH_OF(array);
        switch (zend_hash_get_current_key_ex(target_hash, &string_key, 
&string_length, &num_key, 0, NULL)) {
                case HASH_KEY_IS_STRING:
                        RETVAL_STRINGL(string_key.s, string_length - 1, 1);
@@ -1926,7 +1908,7 @@
 {
        zval *array;
 
-       if (zend_parse_parameters(1 TSRMLS_CC, "a", &array) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == 
FAILURE) {
                RETURN_FALSE;
        }
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to