summaryrefslogtreecommitdiff
path: root/src/tests/disable_function/disabled_functions_runtime.phpt
blob: 8175a778e60899bf407d30da5f64471302fd951e (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
--TEST--
Disable functions - runtime inclusion
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/config_disabled_functions_param_runtime.ini
--FILE--
<?php 
$dir = __DIR__;

// Just in case
@unlink("file_to_include1.php");
@unlink("file_to_include2.php");

$content = '<?php function test($param) { echo $param . "\n"; }';
file_put_contents('file_to_include1.php', $content);
file_put_contents('file_to_include2.php', $content);

if (rand() % 2) {
    include "file_to_include1.php";
} else {
    include "file_to_include2.php";
}

test('1338');test('1337');

?>
--EXPECTF--
1338

Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'test', because its argument '$param' content (1337) matched a rule in %a/file_to_include%d.php on line 1