There are many ways of executing a PHP script. For example you might run it directly from a command line:
php <name_of_the_script>
Other option, readily available for tesing since PHP 5.4, is to spin up the internal PHP server and see the result in a browser:
php -S localhost:3000
If you create a simple page with the function php_sapi_name you will be able to check out the interface that is being used to run the script.