New features PHP 7 - Anonymous Classes 익명 클래스 logger; } public function setLogger(Logger $logger) { $this->logger = $logger; } } $app = new Application; // instance $app->setLogger(new class implements Logger { // anonymous classes injection public function log(string $msg) { print($msg); } }); $app->getLogger()->log("message""); // message