3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Model { public $string; public function __construct() { $this->string = 'MVC + PHP = Awesome!'; } } class View { private $model; private $controller; public function __construct($controller,$model) { $this->controller = $controller; $this->model = $model; } public function output() { return '<p><a href="?action=clicked"'.$this->model->string.'</a></p>'; } } class Controller { private $model; public function __construct($model){ $this->model = $model; } public function clicked() { $this->model->string = 'Updated String!'; } } $model = new Model(); $controller = new Controller($model); $view = new View($controller, $model); if(isset($_GET['action']) && !empty($_GET['action'])) { $controller->{$_GET['action']}(); } echo $view->output(); ?>
Output for git.master, git.master_jit, rfc.property-hooks
<p><a href="?action=clicked"MVC + PHP = Awesome!</a></p>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
49.2 ms | 401 KiB | 8 Q