That doesn't quite work for Easy PHP as it doesn't have the usual "File" menu options listed. However, I did find a solution while testing out your suggestion.
First, I tried using ControlFocus() before calling ControlSend() to pass in "!{f4}" but that didn't work. Next I tried sending the command "!e". "ALT + e" opens a little menu that has the "Exit" option available but I wasn't having any luck activating the "Exit" option from that menu. Just for the heck of it, I passed in "!{f4}" while the "!e" menu was open and it asked if I wanted to shutdown EasyPHP!
Using "!e" to open that little menu before I send "!{f4}" gave focus to the window, where ControlFocus() was failing to. I feel like it's a hack to make up for failings in the other functions, but it does work.
If ProcessExists("EasyPHP-12.1.exe") Then
WinSetState("[CLASS:#32770]", "", @SW_RESTORE)
;ControlFocus("[CLASS:#32770]", "", "[CLASS:ListBox; INSTANCE:1]")
ControlSend("[CLASS:#32770]", "", "[CLASS:ListBox; INSTANCE:1]", "!e")
ControlSend("[CLASS:#32770]", "", "[CLASS:ListBox; INSTANCE:1]", "!{f4}")
ControlSend("[CLASS:#32770]", "&Yes", "[CLASS:Button; INSTANCE:1]", "!y")
EndIf