The main.phpadded auto-loading and creates a new object:
function __autoload($class) {
require_once($class . '.php');
}
...
$t = new Triangle($side1, $side2, $side3);
In Triangle.php:
class Triangle extends Shape {...}
Shape.php - abstract class:
abstract class Shape {
abstract protected function get_area();
abstract protected function get_perimeter();
}
I see that the function __autoloadcalls Triangle.php, but does it call at the same time Shape.php?
source
share