summaryrefslogtreecommitdiff
path: root/src/tests/disabled_functions_callback_called_file_r.phpt
blob: 9c25f9d8ca9ffc79ec062e68ec5f9235299bbcb7 (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
36
37
38
39
--TEST--
Disable functions by matching on the filename_r where the callback function is called, and not defined
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) die "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/config_disabled_functions_callback_called_file_r.ini
--FILE--
<?php
$dir = __DIR__;

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

$mycode = <<< 'EOD'
<?php

function test_callback() {
	return "Test_callback";
}

function test(callable $toto) {
	return $toto();
}
?>
EOD;

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

include "$dir/myfunc_callback.php";

echo test('test_callback');

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