For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > January 2006 > #36149 [Opn]: error handling "{" in key names in parse_ini_file()









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author #36149 [Opn]: error handling "{" in key names in parse_ini_file()
webmaster at dreamsee dot biz

2006-01-24, 9:56 pm

ID: 36149
User updated by: webmaster at dreamsee dot biz
Reported By: webmaster at dreamsee dot biz
Status: Open
Bug Type: Documentation problem
-Operating System: linux, frrebsd
+Operating System: linux, freebsd
PHP Version: 5.1.2
New Comment:

The problem is that it cannot be solved by doublequotes (") like in bug
#33574. Have no solution for now.


Previous Comments:
------------------------------------------------------------------------

[2006-01-25 00:37:04] tony2001@php.net

Related to the change mentioned in bug #33574.
Reclassified as docu problem.

------------------------------------------------------------------------

[2006-01-25 00:30:08] 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
(
)

)




------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=36149&edit=1
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com