I was going to add a shebang line to a php script
#!/bin/env php
but I was looking around and people don't seem to be doing this.
Is it "inappropriate" or against some rule to shebang a php file?
Usually hashbangs are only added when the PHP script is intended to be run from the command line, where it is useful. It is not typically useful to run PHP scripts designed for the web on the command line, and as such, people do not add hashbangs to them.
Also, I believe that in non-CLI PHP environments, PHP will echo the hashbang.
If it's a UNIX shell script the shebang is appropriate. If it's for a webpage it isn't.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With