<?php
interface Interfaze {
public function hello($name);
public function getName();
}
class ParentClazz implements Interfaze {
public function __construct($name) {
$this->hello($name);
}
public function hello($name) {
echo "Hello, $name!\n";
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class ChildClazz extends ParentClazz {
public function __construct($name) {
echo "Loaded from the child class.\n";
parent::__construct($name);
}
}
$childclass = new ChildClazz("Payton");
echo $childclass->getName() . "\n";