xref: /PHP-7.2/ext/phar/tests/ini_set_off.phpt (revision 442fd2f9)
1--TEST--
2Phar: test ini_set with readonly and require_hash disabled
3--SKIPIF--
4<?php
5if (!extension_loaded("phar")) die("skip");
6?>
7--INI--
8phar.require_hash=0
9phar.readonly=0
10--FILE--
11<?php
12var_dump(ini_set('phar.require_hash', 1));
13var_dump(ini_set('phar.readonly', 1));
14var_dump(ini_get('phar.require_hash'));
15var_dump(ini_get('phar.readonly'));
16ini_set('phar.require_hash', 0);
17ini_set('phar.readonly', 0);
18var_dump(Phar::canWrite());
19?>
20yes
21<?php
22var_dump(ini_set('phar.require_hash', 'yes'));
23var_dump(ini_set('phar.readonly', 'yes'));
24var_dump(ini_get('phar.require_hash'));
25var_dump(ini_get('phar.readonly'));
26var_dump(Phar::canWrite());
27ini_set('phar.require_hash', 0);
28ini_set('phar.readonly', 0);
29?>
30on
31<?php
32var_dump(ini_set('phar.require_hash', 'on'));
33var_dump(ini_set('phar.readonly', 'on'));
34var_dump(ini_get('phar.require_hash'));
35var_dump(ini_get('phar.readonly'));
36var_dump(Phar::canWrite());
37ini_set('phar.require_hash', 0);
38ini_set('phar.readonly', 0);
39?>
40true
41<?php
42var_dump(ini_set('phar.require_hash', 'true'));
43var_dump(ini_set('phar.readonly', 'true'));
44var_dump(Phar::canWrite());
45var_dump(ini_get('phar.require_hash'));
46var_dump(ini_get('phar.readonly'));
47?>
480
49<?php
50var_dump(ini_set('phar.require_hash', 0));
51var_dump(ini_set('phar.readonly', 0));
52var_dump(Phar::canWrite());
53var_dump(ini_get('phar.require_hash'));
54var_dump(ini_get('phar.readonly'));
55?>
56===DONE===
57--EXPECT--
58string(1) "0"
59string(1) "0"
60string(1) "1"
61string(1) "1"
62bool(true)
63yes
64string(1) "0"
65string(1) "0"
66string(3) "yes"
67string(3) "yes"
68bool(false)
69on
70string(1) "0"
71string(1) "0"
72string(2) "on"
73string(2) "on"
74bool(false)
75true
76string(1) "0"
77string(1) "0"
78bool(false)
79string(4) "true"
80string(4) "true"
810
82string(4) "true"
83string(4) "true"
84bool(true)
85string(1) "0"
86string(1) "0"
87===DONE===
88