You can use hashbang in PHP files on Mac/Linux systems to help you quickly build PHP scripts that can be run from terminals quickly. Sample:
#!/usr/bin/env php <?php echo 'hello world!';
To make this work for Windows, simply write an accompanying batch file:
@echo off php %~dp0myscript %*
Beautiful and cross-platform.