I am working through the Cookbook’s Brief intro to Object Oriented Programming and am stuck at the section Importing Classes.
When I enter the given code:
<?php
// make PHP display errors on screen
ini_set('display_errors', 1);
// require the book class
require_once __DIR__ . '/Book.php';
require_once __DIR__ . '/Ebook.php';
use Cookbook\Books\Book;
use Cookbook\Books\Ebook;
$book = new Book(…);
$ebook = new Ebook(…);
//…
I get in the browser:
Fatal error : Uncaught Error: Undefined constant “…” in …/book/index.php:11 Stack trace: #0 {main} thrown in …/book/index.php on line 11
Line 11 is:
$book = new Book(…);
I’m not sure what to do to resolve this.
Thank you!