Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class BookShelf implements ArrayAccess, Countable, SeekableIterator {
- protected $_books = array(...);
- protected $_magazines = array(...);
- /**** CLASS CONTENT HERE ****/
- }
- $shelf = new BookShelf();
- // Loops through both arrays, first books (if any) and then magazines (if any)
- foreach($shelf as $item) {
- echo $item;
- }
- count($this->_books);
- $this->_books[$index];
- $this->_magazines[$index-count($this->_books)]
Add Comment
Please, Sign In to add comment