summaryrefslogtreecommitdiff
path: root/src/tests/disable_function/disabled_function_local_var_3.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/disable_function/disabled_function_local_var_3.phpt')
-rw-r--r--src/tests/disable_function/disabled_function_local_var_3.phpt46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/tests/disable_function/disabled_function_local_var_3.phpt b/src/tests/disable_function/disabled_function_local_var_3.phpt
new file mode 100644
index 0000000..597be1d
--- /dev/null
+++ b/src/tests/disable_function/disabled_function_local_var_3.phpt
@@ -0,0 +1,46 @@
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();
14$c = '123';
15$a['qwe'] = 'qwe';
16$a['123'] = 'nop';
17echo "Value of a:\n";
18var_dump($a);
19test();
20
21$a[$c] = (Object)['prop' => 'block'];
22echo "Value of a:\n";
23var_dump($a);
24test();
25?>
26--EXPECTF--
27Value of a:
28array(2) {
29 ["qwe"]=>
30 string(3) "qwe"
31 [123]=>
32 string(3) "nop"
33}
342
35Value of a:
36array(2) {
37 ["qwe"]=>
38 string(3) "qwe"
39 [123]=>
40 object(stdClass)#1 (1) {
41 ["prop"]=>
42 string(5) "block"
43 }
44}
45
46Fatal error: [snuffleupagus][disabled_function] Aborted execution on call of the function 'strlen' in %a/disabled_function_local_var_3.php on line 3 \ No newline at end of file