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