3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Declara a interface 'iTemplate' interface iTemplate { public function setVariable($name, $var); public function getHtml($template); } // Implementa a interface // Isso funcionará class Template implements iTemplate { private $vars = array(); public function setVariable($name, $var) { $this->vars[$name] = $var; } } // Isso NÃO funcionará // Fatal error: Class BadTemplate contains 1 abstract methods // and must therefore be declared abstract (iTemplate::getHtml) class BadTemplate extends Template { private $vars = array(); public function getHtml($template) { foreach($this->vars as $name => $value) { $template = str_replace('{' . $name . '}', $value, $template); } return $template; } } ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Class Template contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (iTemplate::getHtml) in /in/lqclt on line 12
Process exited with code 255.

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:
44.68 ms | 401 KiB | 8 Q