Mission: I need to be able to execute a little bit of code when my PHP CLI scripts are "killed"/closed (usually by me Xing down their windows, or from the PC shutting down or rebooting). Ideally, I would want to also be able to instruct the OS to wait as it performs the last bits of some important job, but I've essentially given up on that "dream"...
Problem: Handling such signals in PHP is apparently done with the "PCNTL" extension, which isn't available for Windows at all! This in spite of the fact that PHP is called "cross-platform".
Although the whole point of what I'm doing is for it to be completely OS-agnostic (no, that doesn't mean "runs on any Linux distro", but all current/supported OSes, or at the very least Windows and Mac), I would in this case accept a solution that is Windows-specific. Not happily, but still...