1--TEST--
2Test fnmatch() function: Basic functionality
3--SKIPIF--
4<?php
5if (!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
15echo "*** Testing fnmatch() with file ***\n";
16$file = basename(__FILE__);
17
18var_dump( fnmatch("*.php", $file) );
19var_dump( fnmatch("*.p*p", $file) );
20var_dump( fnmatch("*.p*", $file) );
21var_dump( fnmatch("*", $file) );
22var_dump( fnmatch("**", $file) );
23var_dump( fnmatch("*.phpt", $file) );
24
25echo "*** Testing fnmatch() with other than file ***\n";
26var_dump( fnmatch(100, 100) );
27var_dump( fnmatch("string", "string") );
28var_dump( fnmatch(TRUE, TRUE) );
29var_dump( fnmatch(FALSE, FALSE) );
30var_dump( fnmatch(NULL, NULL) );
31
32echo "\n*** Done ***\n";
33?>
34--EXPECT--
35*** Testing fnmatch() with file ***
36bool(true)
37bool(true)
38bool(true)
39bool(true)
40bool(true)
41bool(false)
42*** Testing fnmatch() with other than file ***
43bool(true)
44bool(true)
45bool(true)
46bool(true)
47bool(true)
48
49*** Done ***
50