summaryrefslogtreecommitdiff
path: root/ext/standard/tests/strings/dirname_multi_win.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/tests/strings/dirname_multi_win.phpt')
-rw-r--r--ext/standard/tests/strings/dirname_multi_win.phpt13
1 files changed, 9 insertions, 4 deletions
diff --git a/ext/standard/tests/strings/dirname_multi_win.phpt b/ext/standard/tests/strings/dirname_multi_win.phpt
index 4fed5895e6..9dc0c05c59 100644
--- a/ext/standard/tests/strings/dirname_multi_win.phpt
+++ b/ext/standard/tests/strings/dirname_multi_win.phpt
@@ -10,17 +10,22 @@ if((substr(PHP_OS, 0, 3) != "WIN"))
/* 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));
+ try {
+ var_dump(dirname("/foo/bar/baz", $i));
+ } catch (\Error $e) {
+ echo $e->getMessage() . "\n";
+ }
}
+
var_dump(dirname("/foo/bar/baz", PHP_INT_MAX));
var_dump(dirname("g:/foo/bar/baz", PHP_INT_MAX));
var_dump(dirname("g:foo/bar/baz", PHP_INT_MAX));
?>
Done
---EXPECTF--
-Warning: dirname(): Invalid argument, levels must be >= 1 in %sdirname_multi_win.php on line %d
-NULL
+--EXPECT--
+Invalid argument, levels must be >= 1
string(8) "/foo/bar"
string(4) "/foo"
string(1) "\"