3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar { public static function baz($string) { return $string . 'baz'; } } class Renderer { public function render(&$elements) { $elements['#printed'] = TRUE; return $elements['#markup']; } } class Foo { protected $renderer; public function __construct($renderer) { $this->renderer = $renderer; } public function fooIt($text) { $variables = array( 'text' => is_array($text) ? $this->renderer->render($text) : $text, ); $text = Bar::baz($variables['text']); print $text; } } $renderer = new Renderer(); $foo = new Foo($renderer); $text_array = array( '#markup' => 'foo', ); $foo->fooIt($text_array);
Output for git.master, git.master_jit, rfc.property-hooks
foobaz

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