note 97209 added to class.iterator

From: Date: Thu, 08 Apr 2010 12:49:18 +0000
Subject: note 97209 added to class.iterator
Groups: php.notes 
Request: Send a blank email to php-notes+get-168011@lists.php.net to get a copy of this message
Petit exemple avec un tableau indexé : <?php class className implements Iterator { private $_array = array(); private $_cursor = 0; function rewind() { $this->_cursor = 0; } function current() { $keys = array_keys($this->_array); return $this->_array[$keys[$this->_cursor]]; } function key() { return $this->_cursor; } function next() { ++$this->_cursor; } function valid() { $keys = array_keys($this->_array); return isset($keys[$this->_cursor]); } } ?> ---- Server IP: 69.147.83.197 Probable Submitter: 82.122.93.115 ---- Manual Page -- http://www.php.net/manual/en/class.iterator.php Edit -- https://master.php.net/note/edit/97209 Del: integrated -- https://master.php.net/note/delete/97209/integrated Del: useless -- https://master.php.net/note/delete/97209/useless Del: bad code -- https://master.php.net/note/delete/97209/bad+code Del: spam -- https://master.php.net/note/delete/97209/spam Del: non-english -- https://master.php.net/note/delete/97209/non-english Del: in docs -- https://master.php.net/note/delete/97209/in+docs Del: other reasons-- https://master.php.net/note/delete/97209 Reject -- https://master.php.net/note/reject/97209 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#168011) next »