Req #52227 [Com]: parse_ini_* does not parse namespaced constants
| From: | wil dot moore at wilmoore dot com | Date: | Sun, 04 Jul 2010 06:49:49 +0000 |
| Subject: | Req #52227 [Com]: parse_ini_* does not parse namespaced constants | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-152066@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52227&edit=1
ID: 52227
Comment by: wil dot moore at wilmoore dot com
Reported by: wil dot moore at wilmoore dot com
Summary: parse_ini_* does not parse namespaced constants
Status: Open
Type: Feature/Change Request
Package: Filesystem function related
Operating System: Linux, Mac, Windows
PHP Version: 5.3.2
New Comment:
I disagree with the demotion to "Feature Request". This was submitted as
a bug
due to the following rationale:
1 - The parse_ini_* functions currently support expanding constants.
2 - Namespaces were added as a feature and they include allowing
constants to be
included under a namespace.
3 - Every other usage of a function, class/method, or constant works
with the
namespace implementation, exception for parse_ini_* functions.
4 - A constant is a constant regardless of if it is a global constant,
class
constant, or namespaced constant -- functions that support constants
should
honor each of these variations or at the very least, it should be well-
documented if there is a discrepancy.
Give the above facts, I would say this should remain filed as a bug. If
this is
not a software bug, then this is a documentation bug (error). Either
way, it is
a bug.
Previous Comments:
------------------------------------------------------------------------
[2010-07-03 15:44:37] felipe@php.net
Changed to feature request.
------------------------------------------------------------------------
[2010-07-01 20:58:55] wil dot moore at wilmoore dot com
Description:
------------
The parse_ini_file/parse_ini_string pair of functions do not expand
namespaced constants.
Test script:
---------------
<?php
namespace my;
const PROJECT_NAME = 'parse_ini_file_namespaced';
$ini = parse_ini_string(<<<EOF
[TEST_SECTION]
project.constant.global = PROJECT_NAME
project.constant.namspaced = my\PROJECT_NAME
EOF
);
var_export($ini);
Expected result:
----------------
array (
'project.constant.global' => 'parse_ini_file_namespaced',
'project.constant.namspaced' => 'my\\PROJECT_NAME',
)
Actual result:
--------------
array (
'project.constant.global' => 'PROJECT_NAME',
'project.constant.namspaced' => 'my\\PROJECT_NAME',
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52227&edit=1