Purge all installed php packages on Debian

apt list --installed | grep php | python3 -c 'import sys; [sys.stdout.write(i.split("/")[0] + "\n") for i in sys.stdin]' | xargs apt-get -y purge