3v4l.org

run code in 300+ PHP versions simultaneously
<?php $js_file_contents = <<<CONTENTS Survey .StylesManager .applyTheme("default"); var json = { questions: [ { name: "name", type: "text", title: "Please enter your name:", placeHolder: "Jon Snow", isRequired: true }, { name: "birthdate", type: "text", inputType: "date", title: "Your birthdate:", isRequired: true }, { name: "color", type: "text", inputType: "color", title: "Your favorite color:" }, { name: "email", type: "text", inputType: "email", title: "Your e-mail:", placeHolder: "jon.snow@nightwatch.org", isRequired: true, validators: [ { type: "email" } ] } ] }; window.survey = new Survey.Model(json); survey .onComplete .add(function (result) { document .querySelector('#surveyResult') .innerHTML = "result: " + JSON.stringify(result.data); }); $("#surveyElement").Survey({model: survey}); CONTENTS; if (preg_match('~^var json = \K{.*?}(?=;)~ms', $js_file_contents, $match)) { // cut away extra $json = preg_replace('~^\s*\K\w+~m', '"\0"', $match[0]); // quote-wrap the keys var_export(json_decode($json, true)); // convert json string to array and display }
Output for git.master, git.master_jit, rfc.property-hooks
array ( 'questions' => array ( 0 => array ( 'name' => 'name', 'type' => 'text', 'title' => 'Please enter your name:', 'placeHolder' => 'Jon Snow', 'isRequired' => true, ), 1 => array ( 'name' => 'birthdate', 'type' => 'text', 'inputType' => 'date', 'title' => 'Your birthdate:', 'isRequired' => true, ), 2 => array ( 'name' => 'color', 'type' => 'text', 'inputType' => 'color', 'title' => 'Your favorite color:', ), 3 => array ( 'name' => 'email', 'type' => 'text', 'inputType' => 'email', 'title' => 'Your e-mail:', 'placeHolder' => 'jon.snow@nightwatch.org', 'isRequired' => true, 'validators' => array ( 0 => array ( 'type' => 'email', ), ), ), ), )

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:
132.47 ms | 408 KiB | 5 Q