Skip to content

Commit e8bd7bf

Browse files
committed
Add test for display_error_function_args
If this is not enabled by default for tests (like the fatal error backtrace RFC), then at least test for it.
1 parent 7aa56f8 commit e8bd7bf

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
--TEST--
2+
Displaying function arguments in errors
3+
--INI--
4+
display_error_function_args=On
5+
--FILE--
6+
<?php
7+
8+
// A function that sets its own parameters in docref call, to compare
9+
unlink('/');
10+
11+
// Something with sensitive parameters that exists in a minimal build,
12+
// and also doesn't set anything in the docref call. cost is set to 4
13+
// to keep the test fast
14+
$flags = ["salt" => "123456789012345678901" . chr(0), "cost" => 4];
15+
password_hash("test", PASSWORD_BCRYPT, $flags);
16+
17+
ini_set("display_error_function_args", "Off");
18+
19+
unlink('/');
20+
password_hash("test", PASSWORD_BCRYPT, $flags);
21+
22+
?>
23+
--EXPECTF--
24+
Warning: unlink('/'): %s in %s on line %d
25+
26+
Warning: password_hash(Object(SensitiveParameterValue), '2y', Array): The "salt" option has been ignored, since providing a custom salt is no longer supported in %s on line %d
27+
28+
Warning: unlink(/): %s in %s on line %d
29+
30+
Warning: password_hash(): The "salt" option has been ignored, since providing a custom salt is no longer supported in %s on line %d

0 commit comments

Comments
 (0)