Req #51982 [Com]: Unexpected TC_SECTION with parse_ini_file/string
| From: | info at maartendeboer dot net | Date: | Mon, 27 Feb 2012 11:55:52 +0000 |
| Subject: | Req #51982 [Com]: Unexpected TC_SECTION with parse_ini_file/string | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-167882@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=51982&edit=1
ID: 51982
Comment by: info at maartendeboer dot net
Reported by: uramihsayibok at gmail dot com
Summary: Unexpected TC_SECTION with parse_ini_file/string
Status: Open
Type: Feature/Change Request
Package: PHP options/info functions
Operating System: Win 7
PHP Version: *
Block user comment: N
Private report: N
New Comment:
I recommend implementing this the Zend Framework way using '.' as separator for multi
dimension "arrays".
[section]
foo.bar[] = "a"
would then result in:
section
- foo
- bar
- 0 = "a"
Previous Comments:
------------------------------------------------------------------------
[2010-06-02 22:58:48] uramihsayibok at gmail dot com
Description:
------------
parse_ini_file and parse_ini_string can't handle arrays with multiple dimensions.
Test script:
---------------
<?php
$ini = <<<INI
a[b] = "c"
d[e][f] = "g" ; line 2
INI;
var_dump(parse_ini_string($ini));
?>
Expected result:
----------------
An appropriate var_dump
Actual result:
--------------
PHP Warning: syntax error, unexpected TC_SECTION, expecting '=' in Unknown on line 2
(or the INI filename instead of "Unknown" when using parse_ini_file)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=51982&edit=1