#50952 [Opn->Fbk]: parse_ini_file() not parsing constants
| From: | jani@php.net | Date: | Sun, 07 Feb 2010 09:37:22 +0000 |
| Subject: | #50952 [Opn->Fbk]: parse_ini_file() not parsing constants | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-147279@lists.php.net to get a copy of this message | ||
ID: 50952
Updated by: jani@php.net
Reported By: noemail at example dot org
-Status: Open
+Status: Feedback
Bug Type: Filesystem function related
Operating System: CentOS 5
PHP Version: 5.3.1
New Comment:
Please try using this snapshot:
http://snaps.php.net/php5.3-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
IIRC, this was fixed long time ago in SVN repo.
Previous Comments:
------------------------------------------------------------------------
[2010-02-07 08:55:41] noemail at example dot org
Description:
------------
parse_ini_file() is not parsing constants that begin with an
underscore.
CentOS 5 / PHP 5.3.1 from source
Note: This did work as expected in PHP 5.1.6
Reproduce code:
---------------
##### ini.ini #####
[section]
key1 = "no error"
key2buggy = __STRING
key3buggy = __STRING" stays mainly on the plain."
##### test.php #####
<?php
define('__STRING', 'The rain in Spain');
$arr = parse_ini_file('./ini.ini');
print_r($arr);
Expected result:
----------------
Array
(
[section] => Array
(
[key1] => no error
[key2buggy] => The rain in Spain
[key3buggy] => The rain in Spain stays mainly on the
plain.
)
)
Actual result:
--------------
Array
(
[section] => Array
(
[key1] => no error
[key2buggy] => __STRING
[key3buggy] => __STRING stays mainly on the plain.
)
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50952&edit=1