|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46347 parse_ini_file() does not like asterisk (*) in key
Submitted: 2008-10-20 19:40 UTC Modified: 2009-07-22 20:36 UTC
From: duke at masendav dot com Assigned: scottmac
Status: Closed Package: PHP options/info functions
PHP Version: 5.3CVS-2008-11-11 OS: *
Private report: No CVE-ID:
 [2008-10-20 19:40 UTC] duke at masendav dot com
parse_ini_file no longer likes * (asterisk) in configuration keys.

Works just fine in PHP 5.2.5

Reproduce code:
Ini file with the following content:
part1.*.part2 = 1

PHP file:

Expected result:
ini file being parsed without any error messages

Actual result:
Warning: syntax error, unexpected '*' in test.ini on line 2
 in test.php on line 2


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-20 20:45 UTC]
Why should it like it? That looks like a bug that got fixed by the 
new parser. 
 [2008-10-20 21:01 UTC] duke at masendav dot com
More like undocumented feature then. Nothing at says that * cannot be used inside keys. So we are using it in a few in-house applications and this came as unpleasant surprise.

We can of course implement a different solution, if you really consider the current (5.2) behaviour bug.

In which case it would be nice to have a better explanation in parse_ini_file documentation with regard to what is considered a valid syntax and what not.
 [2008-12-24 13:58 UTC]
Jani, this wasn't broken by any of the re2c stuff.

The changes you made to zend_ini_scanner.l revision 1.48 are the cause.
 [2009-01-01 11:57 UTC]
I don't know how to allow literal * in re2c. (\* did not work)
And I don't have spare time to debug this. Ask Pierre if he has.
 [2009-01-01 23:10 UTC]
jani: try [*] or "*" to match a single '*' char
 [2009-02-02 19:25 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-2015 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 23:01:31 2015 UTC