The issue arises because we may not need the same permission for the files as like the directories. Take a website as example. Generally website files have 644 permission and directories have 755 permission.
You know it's a default feature of PHP that you can write HTML codes directly on a PHP script. But have you ever thought about to bounce it? That means write your php codes on a HTML file?