<?
class Launcher {
function launch() {
new Controller();
}
}
class Controller {
function __construct () {
if(!is_object($this->Model)) $this->Model = new Model();
if(!is_object($this->View)) $this->View = new View();
}
}
class Model {
function __construct () {
if(!is_object($this->Controller)) $this->Controller = new Controller();
if(!is_object($this->View)) $this->View = new View();
}
}
class View {
function __construct () {
if(!is_object($this->Controller)) $this->Controller = new Controller();
if(!is_object($this->Model)) $this->Model = new Model();
}
}
$launcher = new Launcher;
$launcher->launch();
?>
PHP says "Fatal error: Maximum function nesting level of '100' reached, aborting! in C:\xampp\htdocs\frameworks\myframe\test3.php on line 10".
How to solve this problem?