This function may produce a Warning:
sapi_windows_set_ctrl_handler(): CTRL events trapping is only supported on console in script.php..
It happens when script is started by "php-cgi.exe", so "php.exe -q" should be used instead.
While pressing CTRL+C don't expect the handler to run instantly, i've ran some curl request in a loop and found that handler runs when either response arrives or request finishes by timeout.