]> granicus.if.org Git - php/commitdiff
Make current() and key() receive argument by value.
authorDmitry Stogov <dmitry@zend.com>
Tue, 24 Feb 2015 14:40:25 +0000 (17:40 +0300)
committerDmitry Stogov <dmitry@zend.com>
Tue, 24 Feb 2015 14:40:25 +0000 (17:40 +0300)
ext/standard/array.c
ext/standard/basic_functions.c
ext/standard/tests/array/009.phpt

index 701e10dff2a66049417768ad40e9bf8d237b6dae..c63caddda8134fa706a7a2c4a532d7e0bc538cbe 100644 (file)
@@ -925,12 +925,12 @@ PHP_FUNCTION(current)
        zval *entry;
 
 #ifndef FAST_ZPP
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS(), "H", &array) == FAILURE) {
                return;
        }
 #else
        ZEND_PARSE_PARAMETERS_START(1, 1)
-               Z_PARAM_ARRAY_OR_OBJECT_HT_EX(array, 0, 1)
+               Z_PARAM_ARRAY_OR_OBJECT_HT(array)
        ZEND_PARSE_PARAMETERS_END();
 #endif
 
@@ -953,12 +953,12 @@ PHP_FUNCTION(key)
        HashTable *array;
 
 #ifndef FAST_ZPP
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS(), "H", &array) == FAILURE) {
                return;
        }
 #else
        ZEND_PARSE_PARAMETERS_START(1, 1)
-               Z_PARAM_ARRAY_OR_OBJECT_HT_EX(array, 0, 1)
+               Z_PARAM_ARRAY_OR_OBJECT_HT(array)
        ZEND_PARSE_PARAMETERS_END();
 #endif
 
index e11b54cf2321ff795a44a72ea5246518e84864f7..4e1ea31294d4437b2d696004f38f329631ec2d1c 100644 (file)
@@ -289,11 +289,11 @@ ZEND_BEGIN_ARG_INFO(arginfo_reset, 0)
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO(arginfo_current, 0)
-       ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arg)
+       ZEND_ARG_INFO(0, arg)
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO(arginfo_key, 0)
-       ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arg)
+       ZEND_ARG_INFO(0, arg)
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_min, 0, 0, 1)
index 8fa51d51ca3d322456e1cb6a47dd57efa1376b06..e0618ad70eed367ae360f21113f03fcc72a98ba7 100644 (file)
@@ -459,9 +459,13 @@ array(5) {
 
 -- Testing variation: when array is unset --
 
+Notice: Undefined variable: unset_array in %s on line %d
+
 Warning: current() expects parameter 1 to be array, null given in %s on line %d
 NULL
 
+Notice: Undefined variable: unset_array in %s on line %d
+
 Warning: key() expects parameter 1 to be array, null given in %s on line %d
 NULL