How does PHP handle file permissions on Windows systems and what are the potential discrepancies with the output of fileperms()?

PHP handles file permissions differently on Windows systems compared to Unix-based systems. On Windows, PHP uses a different method to determine file permissions, which can lead to discrepancies in the output of functions like fileperms(). To address this issue, you can use the `chmod()` function to explicitly set file permissions on Windows systems.

// Set file permissions explicitly on Windows
chmod("file.txt", 0644);