#50952 [Fbk->Opn]: parse_ini_file() not parsing constants

From: Date: Sun, 07 Feb 2010 10:01:42 +0000
Subject: #50952 [Fbk->Opn]: parse_ini_file() not parsing constants
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-147284@lists.php.net to get a copy of this message
 ID:               50952
 User updated by:  noemail at example dot org
 Reported By:      noemail at example dot org
-Status:           Feedback
+Status:           Open
 Bug Type:         Filesystem function related
 Operating System: CentOS 5
 PHP Version:      5.3.1
 New Comment:

Sorry, the problem still occurs in the latest snapshot
(php5.3-201002070930)


Previous Comments:
------------------------------------------------------------------------

[2010-02-07 09:37:22] jani@php.net

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.

------------------------------------------------------------------------

[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



Thread (4 messages)

« previous php.bugs (#147284) next »