PHP 5.4 Installation on Mountain Lion
I strongly suggest you use the package installer or use a full stack of configuration options when compiling, including the --prefix option so you know where the binary gets installed to.

I can only guess PHP 5.4 installed itself into /usr/local/bin or somewhere else and didn't just overwrite the default binary in /usr/bin. And you seem to have not modified your PATH variable to prioritise the bin directory of /usr/local with e.g. PATH="/usr/local/bin:$PATH" in your .bash_profile. So, it's expected running php will still use /usr/bin/php and not /usr/local/bin/php.

Alternatively, you could just symlink the new php binary to /usr/bin/php, (delete or rename the default binary before that):

ln -s /usr/local/bin/php /usr/bin/php