<?php
interface abc {
public function setVariable($name, $var);
public function getVariable($name);
}
class my_abc implements abc {
private $vars = array();
public function setVariable($name, $var) {
$this->vars[$name] = $var;
}
public function getVariable($name) {
return $this->vars[$name];
}
}
$test = new my_abc;
$test->setVariable('foo','bar');
echo $test->getVariable('foo');
?>
<?php
class my_other_class implements abc {
function __construct() {
$this->test = 'something';
}
}
?>