Welcome to scratch pad of usefull shell snippets
dpkg -l | grep php4 | awk '{ print $2 }' | xargs apt-get remove -y