1--TEST-- 2Test posix_strerror() function : error conditions 3--SKIPIF-- 4<?php 5 if(!extension_loaded("posix")) print "skip - POSIX extension not loaded"; 6?> 7--FILE-- 8<?php 9/* Prototype : proto string posix_strerror(int errno) 10 * Description: Retrieve the system error message associated with the given errno. 11 * Source code: ext/posix/posix.c 12 * Alias to functions: 13 */ 14 15echo "*** Testing posix_strerror() : error conditions ***\n"; 16 17echo "\n-- Testing posix_strerror() function with Zero arguments --\n"; 18var_dump( posix_strerror() ); 19 20echo "\n-- Testing posix_strerror() function with more than expected no. of arguments --\n"; 21$errno = posix_get_last_error(); 22$extra_arg = 10; 23var_dump( posix_strerror($errno, $extra_arg) ); 24 25echo "\n-- Testing posix_strerror() function with invalid error number --\n"; 26$errno = -999; 27echo gettype( posix_strerror($errno) )."\n"; 28 29echo "Done"; 30?> 31--EXPECTF-- 32*** Testing posix_strerror() : error conditions *** 33 34-- Testing posix_strerror() function with Zero arguments -- 35 36Warning: posix_strerror() expects exactly 1 parameter, 0 given in %s on line %d 37bool(false) 38 39-- Testing posix_strerror() function with more than expected no. of arguments -- 40 41Warning: posix_strerror() expects exactly 1 parameter, 2 given in %s on line %d 42bool(false) 43 44-- Testing posix_strerror() function with invalid error number -- 45string 46Done 47