In this superuser question I was advised that it is better to execute scripts written in an interpretted language (php, python, etc) by explicitly executing the interpretter and providing the script as an argument, like:
> php script.php
rather than adding a line to the script to tell the OS to execute it, like:
#!/usr/bin/php
<?php
echo "hello world";
?>
Why is this true? My intuition tells me that it s safer, in case the script is moved to a system in which the interpreter s executable is located at a different path, but is that the only reason?