If we put the functions of the interface, also inside the class, so we can create interface?
Example:
Interface
interface Teste {
function olaMundo($texto);
}
Class
class Testando implements Teste {
function olaMundo($texto); //Método da interface
}
Index.php
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Teste</title>
</head>
<body>
<?php
require_once 'Testando.php';
$i = new Testando;
$i->olaMundo("Ola mundo!");
?>
</body>
</html>
Then, what was the role of the interface in this code?