summaryrefslogtreecommitdiff
path: root/ext/standard/tests/strings/dirname_error.phpt
blob: daf4e2cb0aa883af1c1b18091025e280230c2240 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--TEST--
Test dirname() function : error conditions
--FILE--
<?php
/* Prototype: string dirname ( string $path );
   Description: Returns directory name component of path.
*/
echo "*** Testing error conditions ***\n";

// Bad arg
try {
    dirname("/var/tmp/bar.gz", 0);
} catch (\Error $e) {
    echo $e->getMessage() . "\n";
}

echo "Done\n";
?>
--EXPECTF--
*** Testing error conditions ***
Invalid argument, levels must be >= 1
Done