How do I kill all running PHP CLI processes?

for pid in $(ps -ef | grep "php7.2" | awk '{print $2}'); do kill -9 $pid; done
for pid in $(ps -ef | grep "php" | awk '{print $2}'); do kill -9 $pid; done

unix.stackexchange.com/a/50573

See also: How to get the command line used to start a given process?