3v4l.org

run code in 300+ PHP versions simultaneously
<?php class FormBuilder { private function __construct() {} public static function build($form_attributes, $input_attributes) { $content = ''; foreach ($input_attributes as $key => $value) { $content = $content . '\n' + $this::buildInput($key, $value); } list($action, $method) = form_attributes; return $this::buildForm($content, $action, $method); } private static function buildInput($id, $name) { return "<div class=''> <label for='{$id}' class=''>{$name} <input type='text' name='{$name}' id='{$id}' class=''> </label> </div>"; } private static function buildForm($content, $action = '', $method = 'post') { return "<form action='{$action}' class='' method='{$method}'> {$content} </form>"; } private static function callback($key, $value) { buildInput($key, $value); } } $names = [ 'user' => 'Username', 'email' => 'Email', 'fname' => "First Name", 'lname' => 'Last Name', 'pass' => 'Password', 'confirmedpass' => 'Confirmed Password' ]; $form_attributes = [ 'action' => '', 'method' => 'post' ];
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:
49.2 ms | 401 KiB | 8 Q