Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Tells whether a file exists and is readable
<?php is_readable(string $filename): bool
<?php     public static function isReadable($path)

    {

        if (is_readable($path)) {

            return true;

        }
<?php             if (

                !ini_get('open_basedir')

                && is_readable('/proc/version')

                && false !== stripos(Silencer::call('file_get_contents', '/proc/version'), 'microsoft')

                && !file_exists('/.dockerenv') // docker running inside WSL should not be seen as WSL

            ) {
<?php             throw new IOException(sprintf('Could not check if file is readable because path length exceeds %d characters.', $maxPathLength), 0, null, $filename);

        }



        return is_readable($filename);

    }