<?php
class Process {
public static function fork ( $func = null ) {
if ( ( $pid = pcntl_fork() ) === -1 )
throw new Exception('Unable to fork !');
else return $func ? $func($pid) : $pid;
}
?>