3v4l.org

run code in 300+ PHP versions simultaneously
<?php $users = array(); $homepaths = array(); $configlist = array( 'config.php', 'config.inc.php', 'db.inc.php', 'connect.php', 'wp-config.php', 'var.php', 'configure.php', 'database.php', 'db.php', 'configuration.php', 'db_connect.php'); $var = '/var/mail/'; if (is_readable($var) & is_dir($var)) { $userlist = rglob('{*}', GLOB_BRACE, $var); } else { die("cant grab users from {$var}"); } if (!empty($userlist)) { foreach ($userlist as $user) { array_push($users, preg_replace('/^.+[\\\\\\/]/', '', $user)); } } foreach ($users as $usr) { $path = "/home/{$usr}/public_html/"; if (is_dir($path)) { array_push($homepaths, $path); } } foreach ($homepaths as $home) { if (is_dir($home)) { $fileList = rglob('{*.php}', GLOB_BRACE, $home); if (!empty($fileList)) { foreach ($fileList as $f) { //if (in_array(preg_replace('/^.+[\\\\\\/]/', '', $f), $configlist)) { echo $f; // } } } } } /* rglob func borrowed from https://github.com/hm2k/hm2k-php/blob/master/functions/rglob.php */ function rglob($pattern = '*', $flags = 0, $path = '') { $paths = glob($path . '*', GLOB_MARK | GLOB_ONLYDIR | GLOB_NOSORT); $files = glob($path . $pattern, $flags); foreach ($paths as $path) { $files = array_merge($files, rglob($pattern, $flags, $path)); } return $files; } ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: is_readable(): open_basedir restriction in effect. File(/var/mail/) is not within the allowed path(s): (/tmp:/in:/etc) in /in/KYZJo on line 19 Warning: is_dir(): open_basedir restriction in effect. File(/var/mail/) is not within the allowed path(s): (/tmp:/in:/etc) in /in/KYZJo on line 19 cant grab users from /var/mail/

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:
59.75 ms | 402 KiB | 8 Q