2 /* Prototype: bool fnmatch ( string $pattern, string $string [, int $flags] )
3 Description: fnmatch() checks if the passed string would match
4 the given shell wildcard pattern.
6 <<__EntryPoint
>> function main(): void
{
7 echo "*** Testing fnmatch() with file ***\n";
8 $file = basename(__FILE__
);
10 var_dump( fnmatch("*.php", $file) );
11 var_dump( fnmatch("*.p*p", $file) );
12 var_dump( fnmatch("*.p*", $file) );
13 var_dump( fnmatch("*", $file) );
14 var_dump( fnmatch("**", $file) );
15 var_dump( fnmatch("*.phpt", $file) );
17 echo "*** Testing fnmatch() with other than file ***\n";
18 var_dump( fnmatch('100', '100') );
19 var_dump( fnmatch("string", "string") );
20 var_dump( fnmatch('1', '1') );
21 var_dump( fnmatch('', '') );
23 echo "\n*** Done ***\n";