Default Bash 3 overriding shebang /bin/bash with brew installed bash 4
This is the main reason nowadays for using a different shebang:

#!/usr/bin/env bash



Why is #!/usr/bin/env bash superior to #!/bin/bash? - Stack Overflow


This will use the first bash in the PATH, which will most likely be the latest version. Since /bin is in the standard path (getconf PATH), this falls back gracefully for those without a custom bash.