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

Reply via email to