Return to fnmatch_basic.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / file |
1.1 misho 1: --TEST-- 2: Test fnmatch() function: Basic functionality 3: --SKIPIF-- 4: <?php 5: if (!function_exists('fnmatch')) 6: die("skip fnmatch() function is not available"); 7: ?> 8: --FILE-- 9: <?php 10: /* Prototype: bool fnmatch ( string $pattern, string $string [, int $flags] ) 11: Description: fnmatch() checks if the passed string would match 12: the given shell wildcard pattern. 13: */ 14: 15: echo "*** Testing fnmatch() with file ***\n"; 16: $file = basename(__FILE__); 17: 18: var_dump( fnmatch("*.php", $file) ); 19: var_dump( fnmatch("*.p*p", $file) ); 20: var_dump( fnmatch("*.p*", $file) ); 21: var_dump( fnmatch("*", $file) ); 22: var_dump( fnmatch("**", $file) ); 23: var_dump( fnmatch("*.phpt", $file) ); 24: 25: echo "*** Testing fnmatch() with other than file ***\n"; 26: var_dump( fnmatch(100, 100) ); 27: var_dump( fnmatch("string", "string") ); 28: var_dump( fnmatch(TRUE, TRUE) ); 29: var_dump( fnmatch(FALSE, FALSE) ); 30: var_dump( fnmatch(NULL, NULL) ); 31: 32: echo "\n*** Done ***\n"; 33: ?> 34: --EXPECT-- 35: *** Testing fnmatch() with file *** 36: bool(true) 37: bool(true) 38: bool(true) 39: bool(true) 40: bool(true) 41: bool(false) 42: *** Testing fnmatch() with other than file *** 43: bool(true) 44: bool(true) 45: bool(true) 46: bool(true) 47: bool(true) 48: 49: *** Done ***