summaryrefslogtreecommitdiff
path: root/src/tests/disable_function/disabled_functions_chain_call_user_func_ret.phpt
blob: 1a772059fec41c8ddbae58b34ae8361e6bd1abaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
--TEST--
Disable functions by matching the calltrace, on the return value
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/config_disabled_functions_chain_call_user_func_ret.ini
--FILE--
<?php 
function two($a) {
	echo "two\n";
	return $a . "_two";
}
function one($a) {
	echo "one\n";
	two($a);
	return $a . "_one";
}

echo one('not matching') . "\n";
echo one('matching') . "\n";
echo one('still not matching') . "\n";

?>
--EXPECTF--
one
two
not matching_one
one
two

Warning: [snuffleupagus][0.0.0.0][disabled_function][simulation] Aborted execution on return of the function 'two', because the function returned 'matching_two', which matched a rule in %a/disabled_functions_chain_call_user_func_ret.php on line %d
matching_one
one
two
still not matching_one