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