From:             webmaster at dreamsee dot biz
Operating system: linux, frrebsd
PHP version:      5.1.2
PHP Bug Type:     Scripting Engine problem
Bug description:  error handling "{" in key names in parse_ini_file()

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
        (
        )

)



-- 
Edit bug report at http://bugs.php.net/?id=36149&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=36149&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=36149&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=36149&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=36149&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=36149&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=36149&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=36149&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=36149&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=36149&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=36149&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=36149&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=36149&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=36149&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36149&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=36149&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=36149&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=36149&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36149&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=36149&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=36149&r=mysqlcfg

Reply via email to