diff options
| author | Ben Fuhrmannek | 2021-02-18 15:59:41 +0100 |
|---|---|---|
| committer | Ben Fuhrmannek | 2021-02-18 15:59:41 +0100 |
| commit | fb9b3787246dff3e9b76e75f698ff7131ea5403d (patch) | |
| tree | 919b4ba77dcfc5487a3906851c24e71f4d25ad82 /src/tests/disable_function/disabled_function_named_args_skip_pos.phpt | |
| parent | 01528718850c8528ef6d2ed5296e244d4aa7b675 (diff) | |
rewrote parameter matching logic. breaks compatibility with previous versions.
Diffstat (limited to 'src/tests/disable_function/disabled_function_named_args_skip_pos.phpt')
| -rw-r--r-- | src/tests/disable_function/disabled_function_named_args_skip_pos.phpt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/tests/disable_function/disabled_function_named_args_skip_pos.phpt b/src/tests/disable_function/disabled_function_named_args_skip_pos.phpt new file mode 100644 index 0000000..ce85241 --- /dev/null +++ b/src/tests/disable_function/disabled_function_named_args_skip_pos.phpt | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | --TEST-- | ||
| 2 | Disable functions with named arguments (skipping opt. args) by matching argument position | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus") || PHP_VERSION_ID < 80000) print "skip"; ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/config/disabled_function_named_args.ini | ||
| 7 | --FILE-- | ||
| 8 | <?php | ||
| 9 | function foo_named_args_skip_pos($name, $greeting='HI!', $color='red') { | ||
| 10 | echo "boo\n"; | ||
| 11 | } | ||
| 12 | foo_named_args_skip_pos("bob", color: "green"); | ||
| 13 | --EXPECTF-- | ||
| 14 | Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'foo_named_args_skip_pos', because its argument 'color'%s matched a rule in %s.php on line %d \ No newline at end of file | ||
