note 88389 deleted from function.pcntl-fork by danbrown
| From: | danbrown@php.net | Date: | Thu, 22 Jan 2009 02:36:45 +0000 |
| Subject: | note 88389 deleted from function.pcntl-fork by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-149639@lists.php.net to get a copy of this message | ||
Note Submitter: potsedatgmaildotcom
----
Hi, just wanted to put a cleaner written of the example code in the docs.
<?php
$pid = pcntl_fork();
if ( -1 == $pid )
{
die( 'could not fork' );
}
if ( !$pid )
{
// I am a child
}
// I am still the parent
pcntl_wait($status); //Protect against Zombie children
?>