3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function rglob($pattern, $flags = 0, $path = '') { if (!$path && ($dir = dirname($pattern)) != '.') { if ($dir == '\\' || $dir == '/') $dir = ''; return rglob(basename($pattern), $flags, $dir . '/'); } $paths = glob($path . '*', GLOB_ONLYDIR | GLOB_NOSORT); $files = glob($path . $pattern, $flags); foreach ($paths as $p) $files = array_merge($files, rglob($pattern, $flags, $p . '/')); return $files; } $fileList = rglob("*", GLOB_MARK, '/etc/'); foreach($fileList as $index => $file) { if($file[strlen($file) - 1] != "/") { echo "f: ".$file."\n"; } else echo "d: ".$file."\n"; }
Output for 7.2.0
Output for 7.0.20 - 7.1.10
f: /etc/arch-release f: /etc/bash.bash_logout f: /etc/bash.bashrc f: /etc/crypttab f: /etc/fstab f: /etc/gai.conf f: /etc/group f: /etc/gshadow d: /etc/hhvm/ f: /etc/host.conf f: /etc/hosts f: /etc/inputrc f: /etc/issue f: /etc/ld.so.cache f: /etc/ld.so.conf d: /etc/ld.so.conf.d/ f: /etc/locale.gen f: /etc/localtime f: /etc/machine-id f: /etc/motd f: /etc/mtab f: /etc/nscd.conf f: /etc/nsswitch.conf d: /etc/pacman.d/ f: /etc/passwd f: /etc/php.ini f: /etc/php_archive.ini f: /etc/profile d: /etc/profile.d/ f: /etc/protocols f: /etc/resolv.conf f: /etc/rpc f: /etc/securetty f: /etc/services f: /etc/shadow f: /etc/shells d: /etc/skel/ f: /etc/hhvm/cli.hdf d: /etc/hhvm/conf.d/ f: /etc/hhvm/php.ini f: /etc/ld.so.conf.d/hhvm-debian.conf f: /etc/profile.d/freetype2.sh f: /etc/profile.d/locale.sh