PHP: Abstract method within an interface

Knownomnecy

New Member
why cannot I declare an abstract method within an interface? This is my code. Thank you.\[code\]<?phpinterface 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();?>\[/code\]
 
Back
Top