3v4l.org

run code in 300+ PHP versions simultaneously
<?php $output = array(); function saveRawValue($name, $value) { $GLOBALS['output'][$name] = $value; } function parse_phpinfo() { ob_start(); phpinfo(); $s = ob_get_contents(); ob_end_clean(); $s = strip_tags($s, '<h2><th><td>'); $s = preg_replace('/<th[^>]*>([^<]+)<\/th>/', '<info>\1</info>', $s); $s = preg_replace('/<td[^>]*>([^<]+)<\/td>/', '<info>\1</info>', $s); $t = preg_split('/(<h2[^>]*>[^<]+<\/h2>)/', $s, -1, PREG_SPLIT_DELIM_CAPTURE); $r = array(); $count = count($t); $p1 = '<info>([^<]+)<\/info>'; $p2 = '/'.$p1.'\s*'.$p1.'\s*'.$p1.'/'; $p3 = '/'.$p1.'\s*'.$p1.'/'; for ($i = 1; $i < $count; $i++) { if (preg_match('/<h2[^>]*>([^<]+)<\/h2>/', $t[$i], $matchs)) { $name = trim($matchs[1]); $vals = explode("\n", $t[$i + 1]); foreach ($vals AS $val) { if (preg_match($p2, $val, $matchs)) { // 3cols $r[$name][trim($matchs[1])] = array(trim($matchs[2]), trim($matchs[3])); } elseif (preg_match($p3, $val, $matchs)) { // 2cols $r[$name][trim($matchs[1])] = trim($matchs[2]); } } } } return $r; } saveRawValue('phpinfo', parse_phpinfo()); saveRawValue('ii.runtime_user', posix_getuid(), SEPARATION); saveRawValue('ii.runtime_group', posix_getgid(), SEPARATION); echo "<pre>" . json_encode($output) . "</pre>";
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function phpinfo() in /in/KrTUA:9 Stack trace: #0 /in/KrTUA(34): parse_phpinfo() #1 {main} thrown in /in/KrTUA on line 9
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:
32.71 ms | 401 KiB | 8 Q