summaryrefslogtreecommitdiff
path: root/src/tests/disabled_function_local_var_4.phpt
blob: b441576f703e8363affb35ec84738baa4daba637 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
--TEST--
Disable functions - match on a local variable
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) die "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/disabled_function_local_var_2.ini
--FILE--
<?php 
namespace qwe {
  const UNE_CONSTANTE = 'constant';
}
namespace asd {
$b = Array();
$b['_GET[obj->nop]'] = Array();
$b['_GET[obj->nop]']["qwe"] = Array();
$b[456] = Array();
$b[456]['zxc'] = "qwe";
$b[456]['nop'] = "nop";
$b['_GET[obj->nop]']["qwe"][321] = "Yeay";
$b["123"] = "qwe";
$b["123a"] = "foo";
$b["asd"] = "zxc";
$b['_GET]["obj->nop::qwe']["qwe"][1337] = (Object)(['uio' => "valeur de apres"]);
$b['_GET]["obj->nop::qwe']["qwe"][1338] = (Object)(['uio' => "valeur de a"]);
$c = (Object)(['qwe' => Array(\qwe\UNE_CONSTANTE => 'zxc')]);
$idk = 'test_asd';
$class_name = 'test_object';
class test_object {
  const TEST_VALUE = ['constant' => 'truc'];
  private $asd = "qwe";
  public $qwe = 'bar';
  private $test_asd = '';
  function __construct($asd) {
    $this->test_asd = $asd;
  }
  function do_a_barell_roll() {
    var_dump($this->test_asd);
  }
}
$d = new test_object($c);
$a = 1338;
function test(){
  strlen("qwe");
}
echo "Valeur: " . $b['_GET]["obj->nop::qwe']["qwe"][$a]->uio . "\n";
test();

$a = 1337;
echo "Valeur: " . $b['_GET]["obj->nop::qwe']["qwe"][$a]->uio . "\n";
test();
}
?>
--EXPECTF--
Valeur: valeur de a
Valeur: valeur de apres

Fatal error: [snuffleupagus][disabled_function] Aborted execution on call of the function 'strlen' in %a/disabled_function_local_var_4.php on line 36