xref: /PHP-7.1/ext/phar/tests/ini_set_offU.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 Unicode support 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--
59unicode(1) "0"
60unicode(1) "0"
61unicode(1) "1"
62unicode(1) "1"
63bool(true)
64yes
65unicode(1) "0"
66unicode(1) "0"
67unicode(3) "yes"
68unicode(3) "yes"
69bool(false)
70on
71unicode(1) "0"
72unicode(1) "0"
73unicode(2) "on"
74unicode(2) "on"
75bool(false)
76true
77unicode(1) "0"
78unicode(1) "0"
79bool(false)
80unicode(4) "true"
81unicode(4) "true"
820
83unicode(4) "true"
84unicode(4) "true"
85bool(true)
86unicode(1) "0"
87unicode(1) "0"
88===DONE===
89