1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 17:52:16 +01:00
Files
archived-php-src/ext/standard/tests/strings/dirname_multi.phpt
Anatol Belski c2bf735e49 fork test
2015-07-30 09:05:07 +02:00

28 lines
591 B
PHP

--TEST--
Test dirname() function : usage variations
--SKIPIF--
<?php
if((substr(PHP_OS, 0, 3) == "WIN"))
die('skip not for Windows');
?>
--FILE--
<?php
/* Prototype: string dirname ( string $path [, int nb]);
Description: Returns directory name component of path.
*/
for ($i=0 ; $i<5 ; $i++) {
var_dump(dirname("/foo/bar/baz", $i));
}
var_dump(dirname("/foo/bar/baz", PHP_INT_MAX));
?>
Done
--EXPECTF--
Warning: dirname(): Invalid argument, levels must be >= 1 in %sdirname_multi.php on line %d
NULL
string(8) "/foo/bar"
string(4) "/foo"
string(1) "/"
string(1) "/"
string(1) "/"
Done