尝试运行最新版本的PHP时出现奇怪的错误

I followed this guide and then I added /usr/local/bin before the whole $PATH variable so that the newly installed version runs first (instead of the default one). Then when I tried to run php -version from the command line, I get the following error :

Parse error: syntax error, unexpected end of file in Command line code on line 1

I am running Mountain Lion.

It seems that php -version is deprecated for php v5.4.x I tried php -v and it works for both php 5.3.x and php 5.4.x