Php pcntl_fork exit cannot exit child processes

for ($iBoth / Ipp) {

fork_worker();

}

function fork_worker () {

$pid = pcntl_fork();
if($pid == 0){ //child processes
    echo "\r\n";
    $this_id = getmypid();
    echo  $this_id."\r\n";
    exit(1);
}elseif($pid > 0){ //master processes
    echo "\r\n";
}

}
while (1);
according to reason, the child process is already exit, but when viewing the process, the child process still exists, and the bottom while (1) is only executed in the parent process. After thinking about it for a long time, I didn"t understand it and forgot to help answer the question

.
Php
Aug.27,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b32479-2be2c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b32479-2be2c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?