Annotation of embedaddon/php/ext/standard/tests/file/parse_ini_file_variation1.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test parse_ini_file() function : variation: identical properties and values are not referenced.
3: --CREDITS--
4: Dave Kelsey <d_kelsey@uk.ibm.com>
5: --FILE--
6: <?php
7: /* Prototype : array parse_ini_file(string filename [, bool process_sections])
8: * Description: Parse configuration file
9: * Source code: ext/standard/basic_functions.c
10: * Alias to functions:
11: */
12:
13: echo "*** Testing parse_ini_file() : variation ***\n";
14: $output_file = __FILE__.".ini";
15: $iniFile = <<<FILE
16: [section1]
17: value1=original
18: value2=original
19: [section2]
20: value1=original
21: value2=different
22: FILE;
23:
24: file_put_contents($output_file, $iniFile);
25:
26: $a = parse_ini_file($output_file, true);
27: var_dump($a);
28: $a['section1']['value1'] = 'changed';
29: var_dump($a);
30:
31: unlink($output_file);
32: ?>
33: ===DONE===
34: --EXPECT--
35: *** Testing parse_ini_file() : variation ***
36: array(2) {
37: ["section1"]=>
38: array(2) {
39: ["value1"]=>
40: string(8) "original"
41: ["value2"]=>
42: string(8) "original"
43: }
44: ["section2"]=>
45: array(2) {
46: ["value1"]=>
47: string(8) "original"
48: ["value2"]=>
49: string(9) "different"
50: }
51: }
52: array(2) {
53: ["section1"]=>
54: array(2) {
55: ["value1"]=>
56: string(7) "changed"
57: ["value2"]=>
58: string(8) "original"
59: }
60: ["section2"]=>
61: array(2) {
62: ["value1"]=>
63: string(8) "original"
64: ["value2"]=>
65: string(9) "different"
66: }
67: }
68: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>