I have the following four PHP files:
1. Singleton.php
<?php
class Singleton {
    private static $instance = null;
    protected function __clone() {}
    private function __construct() {}
    public static function getInstance() {
        if (self::$instance === null) {
            self::$instance = new self;
        }
        return self::$instance;
    }
}
?>
2. Debugger.php
<?php
interface Debugger {
    public function debug($message);
}
?>
3. DebuggerEcho.php
<?php
require_once 'Singleton.php';
require_once 'Debugger.php';
class DebuggerEcho extends Singleton implements Debugger {
    public function debug($message) {
        echo $message . PHP_EOL;
    }
}
?>
4. TestSingleton.php
<?php
require_once 'DebuggerEcho.php';
$debugger = DebuggerEcho::getInstance();
$debugger->debug('Hello world');
?>
Problem is, when I call line $debugger->debug('Hello world'). I want to keep this structure but avoid this (classical) message:
Call to undefined method Singleton::debug() in TestSingleton.php.
What is going wrong? Thank you for help.
 
     
    