Simple task, simple command:

php -v

For further reading, here’s the PHP documentation on command line usage:

http://www.php.net/features.commandline