pcntl php多进程
<?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++;
}
<?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++;
}