Hi, why cannot I declare an abstract method within an interface? This is my code. Thank you.
<?php
interface Connection {
public abstract function connect();
public function getConnection();
}
abstract class ConnectionAbstract implements Connection() {
private $connection;
public abstract function connect();
public function getConnection() {
return $this->connection;
}
}
class MySQLConnection extends ConnectionAbstract {
public function connect() {
echo 'connecting ...';
}
}
$c = new MySQLConnection();
?>