Are there any best practices for formatting CHMOD permissions when using fileperms() in PHP?

When using the fileperms() function in PHP to retrieve file permissions, it's important to format the permissions correctly for readability and consistency. One common best practice is to use octal notation for specifying permissions, where each digit represents the permissions for owner, group, and others respectively. Additionally, using symbolic notation can make it easier to understand the permissions being set.

// Example of setting permissions using octal notation
chmod($file, 0644);

// Example of setting permissions using symbolic notation
chmod($file, "u=rw,g=r,o=r");