<?php
$pid = pcntl_fork();
if ($pid == -1) {
die('could not fork');
} else if ($pid) {
cli_set_process_title("parent");
} else {
cli_set_process_title("child");
}
sleep(30);
?>
[phil@linux queue]$ ps aux | grep -i 'parent|child' | grep -v grep root 19838 0.6 0.1 257784 23148 pts/2 S+ 19:42 0:00 parent root 19839 0.0 0.1 257784 16936 pts/2 S+ 19:42 0:00 child