|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45991 parse_ini_file returns empty array if config.ini is saved as UTF-8
Submitted: 2008-09-04 10:13 UTC Modified: 2009-07-22 20:36 UTC
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (50.0%)
From: ckl at ecw dot de Assigned:
Status: Closed Package: PHP options/info functions
PHP Version: 5.3.0alpha2 OS: Windows XP SP 3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
30 + 37 = ?
Subscribe to this entry?

 [2008-09-04 10:13 UTC] ckl at ecw dot de
parse_ini_file returns an empty array while trying to parse any ini-file which is saved as UTF-8.
ISO-8859-1 saved ini-files works as expected.

Reproduce code:
; Saved as UTF-8
application.base_url  =
application.data_url  = "data"
database.type         = pdo_mysql         =
database.username     = root
database.password     =         = blog

Expected result:
Get an array..

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-09-04 14:29 UTC]
Would that be UTF-8 with the BOM? or without?
 [2008-09-04 14:30 UTC]
changing to configuration issue
 [2008-09-05 06:49 UTC] ckl at ecw dot de
config.ini was saved as UTF-8 with BOM.
 [2008-09-12 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2008-12-23 15:20 UTC] dirk dot thomas at 4wdmedia dot de
I have the same problem with PHP 5.3.0alpha3 under Windows Vista.
The parsed ini-file was saved as UTF-8 with BOM.
parse_ini returns an empty array for me.
 [2008-12-23 15:39 UTC]
See #46326 as well (ini broken when BOM are present)
 [2008-12-24 13:50 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 22 21:01:31 2024 UTC