php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #36149 error handling "{" in key names in parse_ini_file()
Submitted: 2006-01-25 00:30 UTC Modified: 2006-01-30 16:08 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: webmaster at dreamsee dot biz Assigned:
Status: Closed Package: Documentation problem
PHP Version: 5.1.2 OS: linux, freebsd
Private report: No CVE-ID: None
 [2006-01-25 00:30 UTC] webmaster at dreamsee dot biz
Description:
------------
PHP 5.1.2 cannot handle "{}" in key names, so same code that works on PHP 4.x and 5.0.x, won't work.

Almost same problem described in bug http://bugs.php.net/bug.php?id=33574, but since then it was not added in documentation and it bit different problems, as there it about values, but here problem with keys.

Reproduce code:
---------------
parser.php:
<?php
$ini = parse_ini_file ("./default.lang.php4", true);
echo '<pre>';
print_r($ini);
?>

default.lang.php4:
;<?php exit;?>

[common]
{charset} = "windows-1251"
{title} = "some title"

[check.php]
{fail} = "fail here"

Expected result:
----------------
Array
(
    [common] => Array
        (
            [{charset}] => windows-1251
            [{title}] => some title
        )

    [check.php] => Array
        (
            [{fail}] => fail here
        )

)



Actual result:
--------------
Warning: Error parsing ./default.lang.php4 on line 4 in /home/webadmin/unixro.net/tmp/parser.php on line 2

Array
(
    [common] => Array
        (
        )

)



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-25 00:37 UTC] tony2001@php.net
Related to the change mentioned in bug #33574.
Reclassified as docu problem.
 [2006-01-25 03:26 UTC] webmaster at dreamsee dot biz
The problem is that it cannot be solved by doublequotes (") like in bug #33574. Have no solution for now.
 [2006-01-30 16:08 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 09 22:01:33 2025 UTC