summaryrefslogtreecommitdiff
path: root/src/tests/disabled_function_local_var_5.phpt
diff options
context:
space:
mode:
authorxXx-caillou-xXx2017-12-20 18:09:53 +0100
committerjvoisin2017-12-20 18:09:53 +0100
commite7f541396715ee2895abcf73044b91ae9b746201 (patch)
treeba0e9765e7f14f04b92585df1f3fcd1830ab4b00 /src/tests/disabled_function_local_var_5.phpt
parent8d6cc4f2b63c3f0dc31fe6cecd34ac023ea1cccb (diff)
Better parsing of the rules
Thanks to this huge commit from @xXx-caillou-xXx, we can now write amazingly flexible rules.
Diffstat (limited to 'src/tests/disabled_function_local_var_5.phpt')
-rw-r--r--src/tests/disabled_function_local_var_5.phpt33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/tests/disabled_function_local_var_5.phpt b/src/tests/disabled_function_local_var_5.phpt
new file mode 100644
index 0000000..d82574d
--- /dev/null
+++ b/src/tests/disabled_function_local_var_5.phpt
@@ -0,0 +1,33 @@
1--TEST--
2Disable functions - match on a local variable
3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) die "skip"; ?>
5--INI--
6sp.configuration_file={PWD}/config/disabled_function_local_var.ini
7--FILE--
8<?php
9function test(){
10 echo strlen("id") . "\n";
11}
12
13$a = Array();
14echo "Value of a:\n";
15var_dump($a);
16test();
17
18$a = (Object)['zxc' => 'not a good value'];
19echo "Value of a:\n";
20var_dump($a);
21test();
22?>
23--EXPECTF--
24Value of a:
25array(0) {
26}
272
28Value of a:
29object(stdClass)#1 (1) {
30 ["zxc"]=>
31 string(16) "not a good value"
32}
33[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'strlen' in %a/tests/disabled_function_local_var_5.php:%d has been disabled.