From 8a72ac694a3e876d7cc851653a60f3afc1d00164 Mon Sep 17 00:00:00 2001 From: Peter Cowburn Date: Sun, 4 Oct 2009 14:56:29 +0000 Subject: [PATCH] Updated iterator_apply docs git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@289185 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/spl/functions/iterator-apply.xml | 40 ++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/reference/spl/functions/iterator-apply.xml b/reference/spl/functions/iterator-apply.xml index a9611d378d..6fac30f7ef 100644 --- a/reference/spl/functions/iterator-apply.xml +++ b/reference/spl/functions/iterator-apply.xml @@ -4,7 +4,7 @@ iterator_apply - Apply a user function to every element of an iterator + Call a function for every element in an iterator @@ -28,7 +28,7 @@ iterator - The class to walk through. + The class to iterate over. @@ -37,6 +37,12 @@ The callback function to call on every element. + + + The function must return &true; in order to + continue iterating over the iterator. + + @@ -60,6 +66,36 @@ + + &reftitle.examples; + + + <function>iterator_apply</function> example + +current()) . "\n"; + return TRUE; +} + +$it = new ArrayIterator(array("Apples", "Bananas", "Cherries")); +iterator_apply($it, "print_caps", array($it)); +?> +]]> + + &example.outputs; + + + + + + +