diff options
Diffstat (limited to 'src/tests/disable_function/disabled_function_local_var_5.phpt')
| -rw-r--r-- | src/tests/disable_function/disabled_function_local_var_5.phpt | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/tests/disable_function/disabled_function_local_var_5.phpt b/src/tests/disable_function/disabled_function_local_var_5.phpt new file mode 100644 index 0000000..602e96e --- /dev/null +++ b/src/tests/disable_function/disabled_function_local_var_5.phpt | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | --TEST-- | ||
| 2 | Disable functions - match on a local variable | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) die "skip"; ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/config/disabled_function_local_var.ini | ||
| 7 | --FILE-- | ||
| 8 | <?php | ||
| 9 | function test(){ | ||
| 10 | echo strlen("id") . "\n"; | ||
| 11 | } | ||
| 12 | |||
| 13 | $a = Array(); | ||
| 14 | echo "Value of a:\n"; | ||
| 15 | var_dump($a); | ||
| 16 | test(); | ||
| 17 | |||
| 18 | $a = (Object)['zxc' => 'not a good value']; | ||
| 19 | echo "Value of a:\n"; | ||
| 20 | var_dump($a); | ||
| 21 | test(); | ||
| 22 | ?> | ||
| 23 | --EXPECTF-- | ||
| 24 | Value of a: | ||
| 25 | array(0) { | ||
| 26 | } | ||
| 27 | 2 | ||
| 28 | Value of a: | ||
| 29 | object(stdClass)#1 (1) { | ||
| 30 | ["zxc"]=> | ||
| 31 | string(16) "not a good value" | ||
| 32 | } | ||
| 33 | |||
| 34 | Fatal error: [snuffleupagus][disabled_function] Aborted execution on call of the function 'strlen' in %a/disabled_function_local_var_5.php on line 3 \ No newline at end of file | ||
