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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
--TEST--
Phar: test ini_set with readonly and require_hash disabled
--SKIPIF--
<?php
if (!extension_loaded("phar")) die("skip");
?>
--INI--
phar.require_hash=0
phar.readonly=0
--FILE--
<?php
var_dump(ini_set('phar.require_hash', 1));
var_dump(ini_set('phar.readonly', 1));
var_dump(ini_get('phar.require_hash'));
var_dump(ini_get('phar.readonly'));
ini_set('phar.require_hash', 0);
ini_set('phar.readonly', 0);
var_dump(Phar::canWrite());
?>
yes
<?php
var_dump(ini_set('phar.require_hash', 'yes'));
var_dump(ini_set('phar.readonly', 'yes'));
var_dump(ini_get('phar.require_hash'));
var_dump(ini_get('phar.readonly'));
var_dump(Phar::canWrite());
ini_set('phar.require_hash', 0);
ini_set('phar.readonly', 0);
?>
on
<?php
var_dump(ini_set('phar.require_hash', 'on'));
var_dump(ini_set('phar.readonly', 'on'));
var_dump(ini_get('phar.require_hash'));
var_dump(ini_get('phar.readonly'));
var_dump(Phar::canWrite());
ini_set('phar.require_hash', 0);
ini_set('phar.readonly', 0);
?>
true
<?php
var_dump(ini_set('phar.require_hash', 'true'));
var_dump(ini_set('phar.readonly', 'true'));
var_dump(Phar::canWrite());
var_dump(ini_get('phar.require_hash'));
var_dump(ini_get('phar.readonly'));
?>
0
<?php
var_dump(ini_set('phar.require_hash', 0));
var_dump(ini_set('phar.readonly', 0));
var_dump(Phar::canWrite());
var_dump(ini_get('phar.require_hash'));
var_dump(ini_get('phar.readonly'));
?>
===DONE===
--EXPECT--
string(1) "0"
string(1) "0"
string(1) "1"
string(1) "1"
bool(true)
yes
string(1) "0"
string(1) "0"
string(3) "yes"
string(3) "yes"
bool(false)
on
string(1) "0"
string(1) "0"
string(2) "on"
string(2) "on"
bool(false)
true
string(1) "0"
string(1) "0"
bool(false)
string(4) "true"
string(4) "true"
0
string(4) "true"
string(4) "true"
bool(true)
string(1) "0"
string(1) "0"
===DONE===
|