3v4l.org

run code in 500+ PHP versions simultaneously
<?php ini_set('open_basedir', getcwd()); $path='../'; function throwErrorException($errno, $errstr, $errfile, $errline) { throw new ErrorException($errstr, 0, $errno, $errfile, $errline); } set_error_handler('throwErrorException', E_WARNING); try { $isDir = (is_dir($path) === false || is_readable($path) === false); } catch (ErrorException $error) { $isDir = false; } restore_error_handler(); var_dump($isDir);

preferences:
77 ms | 2698 KiB | 5 Q