This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This is small demonstration of PHPs signal handling behavior. | |
* | |
* Both methods will fork children using pcntl_fork and output whether or not forked parent/child were created inside | |
* of the registered sigHandler function, if it's the child or parent, and their respective PIDs. | |
* | |
* If you run spawnChildInsideHandler and attempt to send a SIGTERM (15) to either of the two processes | |
* you will receive no response. To exit you will have to force kill with SIGKILL (9) |