$book2Borrower = new Borrower("Michael", "Neuhaus"); $book2 = new Book(2, "Secrets Of The JavaScript Ninja", $book2Author, $book2Publisher, $book2Borrower); $book3Author = new Author("Mark Ethan", "Trostler"); $book3Publisher = new Publisher("O'Reilly"); $book3Borrower = new Borrower(); $book3 = new Book(3, "Testable JavaScript", $book3Author, $book3Publisher, $book3Borrower); $book4Author = new Author("Stoyan", "Stefanov"); $book4Publisher = new Publisher("O'Reilly"); $book4Borrower = new Borrower("Daniel", "Schulz"); $book4 = new Book(4, "JavaScript Patterns", $book4Author, $book4Publisher, $book4Borrower); $book5Author = new Author("Marijn", "Haverbeke"); $book5Publisher = new Publisher("no starch press"); $book5Borrower = new Borrower(); $book5 = new Book(5, "Eloquent JavaScript", $book5Author, $book5Publisher, $book5Borrower); $newBookshelf = new Bookshelf(); $newBookshelf->addOneBookToArray($book1); $newBookshelf->addOneBookToArray($book2); $newBookshelf->addOneBookToArray($book3); $newBookshelf->addOneBookToArray($book4); $newBookshelf->addOneBookToArray($book5); $type = (int) $_GET['type']; if (isset($_GET['type'])) { if ($type === 1) { $pinkBrowserPrinter = new BrowserPrinter($newBookshelf); } else { if ($type === 2) { $pinkDataPrinter = new DataPrinter($newBookshelf); } else { echo "Nothing to print."; } }