Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Gets file permissions
fileperms(string $filename): int|false
            return chmod($path$mode);

        }



        return 
substr(sprintf('%o'fileperms($path)), -4);

    }
        file_put_contents(self::$tempDir.'/file.txt''Hello World');

        
$files = new Filesystem;

        
$files->chmod(self::$tempDir.'/file.txt'0755);

        
$filePermission substr(sprintf('%o'fileperms(self::$tempDir.'/file.txt')), -4);

        
$expectedPermissions DIRECTORY_SEPARATOR === '\\' '0666' '0755';

        
$this->assertEquals($expectedPermissions$filePermission);

    }
    private function getFilePermissions($file)

    {

        
$filePerms fileperms($file);

        
$filePerms substr(sprintf('%o'$filePerms), -3);



        return (int) 
base_convert($filePerms810);