Strange PHP Path Glitch After 10.8.5 Update

I had an odd problem after updating to OS X 10.8.5. Namely, the system seemed to have forgotten which PHP to use (in my case, I want the MacPorts version to be the default. I checked all the usual suspects like /etc/paths and ~/.bash_profile to see if the update had reset their contents. Nope.

Now, this may be unrelated to Mac OS X, and it simply manifested itself after the update, but I noticed there was no php binary in /opt/local/bin. There was, however, a binary called php54.

which php
cd /opt/local/bin
sudo ln -s php54 php
which php

All is well again.