<?php
$i=0;
while($i!=5){
$pid = pcntl_fork();
if ($pid == 0) {
echo $pid."---------hahah".getmypid().PHP_EOL;
return;
} else if($pid > 0) {
pcntl_wait($status);
} else {
echo "can not fork";
}
$i++;
}
2024-01-30 10:39:52
<?php
$i=0;
while($i!=5){
$pid = pcntl_fork();
if ($pid == 0) {
echo $pid."---------hahah".getmypid().PHP_EOL;
return;
} else if($pid > 0) {
pcntl_wait($status);
} else {
echo "can not fork";
}
$i++;
}