File: parse_ini_booleans.phpt

package info (click to toggle)
php8.4 8.4.11-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 208,108 kB
  • sloc: ansic: 1,060,628; php: 35,345; sh: 11,866; cpp: 7,201; pascal: 4,913; javascript: 3,091; asm: 2,810; yacc: 2,411; makefile: 689; xml: 446; python: 301; awk: 148
file content (69 lines) | stat: -rw-r--r-- 1,237 bytes parent folder | download
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
--TEST--
parse_ini_file() boolean operators
--FILE--
<?php

$ini_file = __DIR__."/parse_ini_booleans.data";

var_dump(parse_ini_file($ini_file, 1));

echo "Done.\n";

?>
--EXPECT--
array(3) {
  ["error_reporting values"]=>
  array(6) {
    ["foo"]=>
    string(7) "30719 8"
    ["error_reporting"]=>
    string(5) "30719"
    ["error_reporting1"]=>
    string(4) "4177"
    ["error_reporting2"]=>
    string(5) "30711"
    ["error_reporting3"]=>
    string(5) "30711"
    ["error_reporting4"]=>
    string(5) "30711"
  }
  ["true or false"]=>
  array(8) {
    ["bool_true"]=>
    string(1) "1"
    ["bool_yes"]=>
    string(1) "1"
    ["bool_on"]=>
    string(1) "1"
    ["bool_false"]=>
    string(0) ""
    ["bool_off"]=>
    string(0) ""
    ["bool_no"]=>
    string(0) ""
    ["bool_none"]=>
    string(0) ""
    ["bool_null"]=>
    string(0) ""
  }
  ["strings"]=>
  array(8) {
    ["string_true"]=>
    string(4) "true"
    ["string_yes"]=>
    string(4) " yes"
    ["string_on"]=>
    string(5) "  on "
    ["string_false"]=>
    string(5) "false"
    ["string_off"]=>
    string(4) "Off "
    ["string_no"]=>
    string(4) "No	 "
    ["string_none"]=>
    string(5) " NoNe"
    ["string_null"]=>
    string(4) "NULl"
  }
}
Done.