Saves you some time and nerve. Especially when you’ve been writing code for a while, check it locally before you upload it to a remote server, even to a test site.
php -l ~sites/mysite/functions.php
This -l option means “check syntaxt only”.
Simple? Yes, and that’s the point!