1--TEST--
2Bug #48660 (parse_ini_*(): dollar sign as last character of value fails)
3--FILE--
4<?php
5
6$ini_location = dirname(__FILE__) . '/bug48660.tmp';
7
8// Build ini data
9$ini_data = '
10[cases]
11
12Case.a = avalue
13Case.b = "$dollar_sign"
14Case.c = "dollar_sign$"
15Case.d = "$dollar_sign$"
16Case.e = 10
17';
18
19// Save ini data to file
20file_put_contents($ini_location, $ini_data);
21
22var_dump(parse_ini_file($ini_location, true, INI_SCANNER_RAW));
23var_dump(parse_ini_file($ini_location, true, INI_SCANNER_NORMAL));
24
25?>
26--CLEAN--
27<?php @unlink(dirname(__FILE__) . '/bug48660.tmp'); ?>
28--EXPECT--
29array(1) {
30  ["cases"]=>
31  array(5) {
32    ["Case.a"]=>
33    string(6) "avalue"
34    ["Case.b"]=>
35    string(12) "$dollar_sign"
36    ["Case.c"]=>
37    string(12) "dollar_sign$"
38    ["Case.d"]=>
39    string(13) "$dollar_sign$"
40    ["Case.e"]=>
41    string(2) "10"
42  }
43}
44array(1) {
45  ["cases"]=>
46  array(5) {
47    ["Case.a"]=>
48    string(6) "avalue"
49    ["Case.b"]=>
50    string(12) "$dollar_sign"
51    ["Case.c"]=>
52    string(12) "dollar_sign$"
53    ["Case.d"]=>
54    string(13) "$dollar_sign$"
55    ["Case.e"]=>
56    string(2) "10"
57  }
58}
59