3v4l.org

run code in 500+ PHP versions simultaneously
<?php $x = new class { public $context; public function rmdir(string $path, int $options = 0): bool { var_dump("rmdir: $path"); return true; } public function unlink(string $path, int $options = 0): bool { var_dump("unlink: $path"); return true; } public function url_stat(string $path, int $flags): array|false { var_dump("url_stat: $path"); return []; } }; stream_wrapper_register('test', get_class($x)); $dir = 'test://foo/bar'; var_dump(is_dir($dir)); var_dump(rmdir($dir)); var_dump(is_dir($dir)); var_dump(unlink($dir)); var_dump(is_dir($dir)); clearstatcache(); var_dump(is_dir($dir));
Output for git.master, git.master_jit
string(24) "url_stat: test://foo/bar" bool(false) string(21) "rmdir: test://foo/bar" bool(true) bool(false) string(22) "unlink: test://foo/bar" bool(true) bool(false) string(24) "url_stat: test://foo/bar" bool(false)

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:
39.97 ms | 869 KiB | 4 Q