note 114311 deleted from language.oop5.interfaces by cmb
| From: | cmb@php.net | Date: | Sun, 26 Jan 2020 09:41:03 +0000 |
| Subject: | note 114311 deleted from language.oop5.interfaces by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-213959@lists.php.net to get a copy of this message | ||
Note Submitter: bombis at lacerta dot uberspace dot de
----
simple example :)
<?php
interface testThis
{
public function alpha();
public function beta();
}
trait setInterface
{
public function alpha()
{
echo __function__." wurde implementiert";
}
}
class b
{
public function beta()
{
echo __function__." wurde implementiert";
}
}
class a extends b implements testThis
{
use setInterface;
/*
public function alpha()
{
echo __function__." wurde implementiert";
}
public function beta()
{
echo __function__." wurde implementiert";
}
*/
public function __construct()
{
echo "wat geht? <br>";
}
}
$testInterface = new a();
$testInterface ->alpha();
echo "<br>";
$testInterface ->beta();
?>