Annotation of embedaddon/php/ext/pcntl/tests/pcntl_fork_basic.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test function pcntl_fork() by calling it with its expected arguments
! 3: --CREDITS--
! 4: Marco Fabbri mrfabbri@gmail.com
! 5: Francesco 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
! 14: echo "*** Test by calling method or function with its expected arguments, first print the child PID and the father ***\n";
! 15:
! 16: $pid = pcntl_fork();
! 17: if ($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 ***
! 26: int(0)
! 27: int(%d)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>