PHP 8.5.0 Alpha 2 available for testing

Voting

: max(six, two)?
(Example: nine)

The Note You're Voting On

xuecan at google dot com
18 years ago
I think this simple code can help understand how fork works:

<?php
echo "posix_getpid()=".posix_getpid().", posix_getppid()=".posix_getppid()."\n";

$pid = pcntl_fork();
if (
$pid == -1) die("could not fork");
if (
$pid) {
echo
"pid=".$pid.", posix_getpid()=".posix_getpid().", posix_getppid()=".posix_getppid()."\n";
} else {
echo
"pid=".$pid.", posix_getpid()=".posix_getpid().", posix_getppid()=".posix_getppid()."\n";
}
?>

<< Back to user notes page

To Top