3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Page { private $pageReader; public function __construct(PageReader $pageReader) { $this->pageReader = $pageReader; } public function show($params) { $data['content'] = $this->pageReader->readBySlug($slug); } } interface PageReader { public function readBySlug(string $slug) : string; } class FilePageReader implements PageReader { private $pageFolder; public function __construct(string $pageFolder) { $this->pageFolder = $pageFolder; } public function readBySlug(string $slug) : string { $path = "$this->pageFolder/$slug.md"; if (!file_exists($path)) { throw new Exception($slug); } return file_get_contents($path); } }
Output for git.master, git.master_jit, rfc.property-hooks

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:
110.01 ms | 1422 KiB | 4 Q