1
0
mirror of https://github.com/php/php-src.git synced 2026-04-03 06:02:23 +02:00
Files
archived-php-src/ext/standard/tests/strings/dirname_error.phpt
2020-03-18 19:56:10 +01:00

21 lines
450 B
PHP

--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 (\ValueError $e) {
echo $e->getMessage() . "\n";
}
?>
--EXPECT--
*** Testing error conditions ***
dirname(): Argument #2 ($levels) must be greater than or equal to 1