diff options
author | George Peter Banyard <girgias@php.net> | 2019-08-22 11:58:57 +0200 |
---|---|---|
committer | George Peter Banyard <girgias@php.net> | 2019-08-22 21:44:01 +0200 |
commit | fe44e1637a683de9414e155f034bab993dd8aee3 (patch) | |
tree | 30bd01577b1fa35859fbd1a81385117239b77c58 /ext/standard/tests/strings/dirname_error.phpt | |
parent | 698491d98a8d34e1d531a36f5dba30fc424b826f (diff) | |
download | php-git-fe44e1637a683de9414e155f034bab993dd8aee3.tar.gz |
Promote warnings to errors in dirname()
Diffstat (limited to 'ext/standard/tests/strings/dirname_error.phpt')
-rw-r--r-- | ext/standard/tests/strings/dirname_error.phpt | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/standard/tests/strings/dirname_error.phpt b/ext/standard/tests/strings/dirname_error.phpt index 79fac30029..daf4e2cb0a 100644 --- a/ext/standard/tests/strings/dirname_error.phpt +++ b/ext/standard/tests/strings/dirname_error.phpt @@ -8,13 +8,15 @@ Test dirname() function : error conditions echo "*** Testing error conditions ***\n"; // Bad arg -var_dump( dirname("/var/tmp/bar.gz", 0) ); +try { + dirname("/var/tmp/bar.gz", 0); +} catch (\Error $e) { + echo $e->getMessage() . "\n"; +} echo "Done\n"; ?> --EXPECTF-- *** Testing error conditions *** - -Warning: dirname(): Invalid argument, levels must be >= 1 in %s on line %d -NULL +Invalid argument, levels must be >= 1 Done |