diff options
Diffstat (limited to 'src/tests/disabled_function_local_var_3.phpt')
| -rw-r--r-- | src/tests/disabled_function_local_var_3.phpt | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/tests/disabled_function_local_var_3.phpt b/src/tests/disabled_function_local_var_3.phpt new file mode 100644 index 0000000..d26b636 --- /dev/null +++ b/src/tests/disabled_function_local_var_3.phpt | |||
| @@ -0,0 +1,45 @@ | |||
| 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 | $c = '123'; | ||
| 15 | $a['qwe'] = 'qwe'; | ||
| 16 | $a['123'] = 'nop'; | ||
| 17 | echo "Value of a:\n"; | ||
| 18 | var_dump($a); | ||
| 19 | test(); | ||
| 20 | |||
| 21 | $a[$c] = (Object)['prop' => 'block']; | ||
| 22 | echo "Value of a:\n"; | ||
| 23 | var_dump($a); | ||
| 24 | test(); | ||
| 25 | ?> | ||
| 26 | --EXPECTF-- | ||
| 27 | Value of a: | ||
| 28 | array(2) { | ||
| 29 | ["qwe"]=> | ||
| 30 | string(3) "qwe" | ||
| 31 | [123]=> | ||
| 32 | string(3) "nop" | ||
| 33 | } | ||
| 34 | 2 | ||
| 35 | Value of a: | ||
| 36 | array(2) { | ||
| 37 | ["qwe"]=> | ||
| 38 | string(3) "qwe" | ||
| 39 | [123]=> | ||
| 40 | object(stdClass)#1 (1) { | ||
| 41 | ["prop"]=> | ||
| 42 | string(5) "block" | ||
| 43 | } | ||
| 44 | } | ||
| 45 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'strlen' in %a/tests/disabled_function_local_var_3.php:%d has been disabled. | ||
