Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * The purpose of this document is to brainstorm a possible inheritance scheme
- * usable for a new set of PHP data-structures. It is by no means final.
- */
- namespace Spl;
- /**
- * By Collection, we do not mean the same thing as a Java collection. It is
- * simply a name by which we can give generic properties to.
- *
- *
- */
- interface Collection extends \Countable, \Iterator, \Serializable {
- function clear();
- function contains($item);
- function isEmpty();
- }
- interface Vector extends Collection, \ArrayAccess {
- }
- class ArrayList implements Vector {
- }
- class LinkedList implements Vector {
- }
- class Stack implements \Collection {
- function peek();
- function pop();
- function push($item);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment