That's how literally anything which is "executable" works. You just point the interpreter (kernel, ld-linux, php, python, ...) at a file, and it runs the file.
Sure, once you've set up the web server, and PHP itself, and installed (usually through a not-easily-wget'able link) the program you want, and configured it, and set up its permissions properly...