From fdbd42daea7ac25befbf6539f6cad605803da045 Mon Sep 17 00:00:00 2001 From: Andrei Zmievski Date: Wed, 15 Dec 1999 18:45:44 +0000 Subject: [PATCH] Clarified the use of reset() for array_walk(). git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@17259 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/array.xml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/functions/array.xml b/functions/array.xml index 93a0a4839b..0ae5be5ff7 100644 --- a/functions/array.xml +++ b/functions/array.xml @@ -708,7 +708,12 @@ array_values($array); // returns array("XL", "gold") - Passing the key and userdata to func was added in 4.0. + Passing the key and userdata to func was + added in 4.0. + + In PHP 4 reset needs to be called as + necessary since array_walk does not reset + the array by default. @@ -726,7 +731,9 @@ function test_print( $item2, $key ) { } array_walk( $fruits, 'test_print' ); +reset($fruits); array_walk( $fruits, 'test_alter', 'fruit' ); +reset($fruits); array_walk( $fruits, 'test_print' ); @@ -1823,7 +1830,7 @@ sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil -sgml-default-dtd-file:"../manual.ced" +sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil