1--TEST--
2Test function pcntl_fork() by calling it with its expected arguments
3--CREDITS--
4Marco Fabbri mrfabbri@gmail.com
5Francesco Fullone ff@ideato.it
6#PHPTestFest Cesena Italia on 2009-06-20
7--SKIPIF--
8<?php
9    if (!extension_loaded('pcntl')) die('skip pcntl extension not available');
10    elseif (!extension_loaded('posix')) die('skip posix extension not available');
11?>
12--FILE--
13<?php
14echo "*** Test by calling method or function with its expected arguments, first print the child PID and the father ***\n";
15
16$pid = pcntl_fork();
17if ($pid > 0) {
18    pcntl_wait($status);
19    var_dump($pid);
20} else {
21    var_dump($pid);
22}
23?>
24--EXPECTF--
25*** Test by calling method or function with its expected arguments, first print the child PID and the father ***
26int(0)
27int(%d)
28