summaryrefslogtreecommitdiff
path: root/src/tests/disabled_functions_namespace.phpt
blob: 893433703aba9d8bc98112516f1ccc6c62607f7e (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
--TEST--
Disable functions in namespaces
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) die "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/config_disabled_functions_namespace.ini
--FILE--
<?php 
namespace my_super_namespace {
	function my_function() {
		echo "Should not be printed\n";
	}
}
namespace my_second_namespace {
	function my_function() {
		echo "Second namespace\n";
	}
}
namespace {
	function my_function() {
		echo "Anonymous namespace\n";
	}
\strcmp("1", "2");
\my_super_namespace\my_function();
\my_second_namespace\my_function();
my_function();
}
?>
--EXPECTF--
[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'strcmp' in %a/disabled_functions_namespace.php:%d has been disabled.
[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'my_super_namespace\my_function' in %a/disabled_functions_namespace.php:%d has been disabled.
Second namespace
Anonymous namespace