File: bug63512.phpt

package info (click to toggle)
php8.4 8.4.16-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 211,276 kB
  • sloc: ansic: 1,176,142; php: 35,419; sh: 11,964; cpp: 7,208; pascal: 4,951; javascript: 3,091; asm: 2,817; yacc: 2,411; makefile: 696; xml: 446; python: 301; awk: 148
file content (33 lines) | stat: -rw-r--r-- 717 bytes parent folder | download | duplicates (3)
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
--TEST--
Fixed bug #63512 (parse_ini_file() with INI_SCANNER_RAW removes quotes from value).
--FILE--
<?php

$array = parse_ini_string('
        int = 123
        constant = INSTALL_ROOT
        quotedString = "string"
        a = INSTALL_ROOT "waa"
        b = "INSTALL_ROOT"
        c = "waa" INSTALL_ROOT
        d = INSTALL_ROOT "INSTALL_ROOT"', false, INI_SCANNER_RAW);

var_dump($array);
?>
--EXPECT--
array(7) {
  ["int"]=>
  string(3) "123"
  ["constant"]=>
  string(12) "INSTALL_ROOT"
  ["quotedString"]=>
  string(6) "string"
  ["a"]=>
  string(18) "INSTALL_ROOT "waa""
  ["b"]=>
  string(12) "INSTALL_ROOT"
  ["c"]=>
  string(18) ""waa" INSTALL_ROOT"
  ["d"]=>
  string(27) "INSTALL_ROOT "INSTALL_ROOT""
}