note 112827 added to class.cachingiterator
| From: | seyferseed at mail dot ru | Date: | Sat, 27 Jul 2013 07:52:08 +0000 |
| Subject: | note 112827 added to class.cachingiterator | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-195788@lists.php.net to get a copy of this message | ||
With this helpful iterator you can use hasNext() method, becouse inline iterator cached
<?php
$names = array("Jessey", "Joe","Jane");
$inames = new ArrayIterator($names);
$ci = new CachingIterator($inames);
foreach ($ci as $item)
{
echo $item;
if ($item->hasNext())
echo " , ";
}
//output
//Jessey, Joe, Jane
?>
----
Server IP: 69.147.83.199
Probable Submitter: 46.182.129.8
----
Manual Page -- http://php.net/manual/en/class.cachingiterator.php
Edit -- https://master.php.net/note/edit/112827
Del: integrated -- https://master.php.net/note/delete/112827/integrated
Del: useless -- https://master.php.net/note/delete/112827/useless
Del: bad code -- https://master.php.net/note/delete/112827/bad+code
Del: spam -- https://master.php.net/note/delete/112827/spam
Del: non-english -- https://master.php.net/note/delete/112827/non-english
Del: in docs -- https://master.php.net/note/delete/112827/in+docs
Del: other reasons-- https://master.php.net/note/delete/112827
Reject -- https://master.php.net/note/reject/112827
Search -- https://master.php.net/manage/user-notes.php