summaryrefslogtreecommitdiff
path: root/src/tests/disable_function/disabled_functions_called_file_r.phpt
blob: e59235989735805e5457a3ff24d0f7bb226d9ec6 (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 on the filename_r where the function is called, and not defined
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/config_disabled_functions_called_file_r.ini
--FILE--
<?php
$dir = __DIR__;

@unlink("$dir/myfunc.php");

$mycode = <<< EOD
<?php
function test() {
	echo "TOTO";
}
?>
EOD;

file_put_contents("$dir/myfunc.php", $mycode);

include "$dir/myfunc.php";

test();

?>
--CLEAN--
<?php
$dir = __DIR__;
@unlink("$dir/myfunc.php");
?>
--EXPECTF--
Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'test' in %a/myfunc.php on line 3