php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #19608 parse_ini_file(): undocumented behaviour with constants
Submitted: 2002-09-26 03:58 UTC Modified: 2002-11-19 02:54 UTC
Votes:2
Avg. Score:3.5 ± 0.5
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: jaenecke at gmx dot li Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.2.3 OS: Linux 2.4.18
Private report: No CVE-ID: None
 [2002-09-26 03:58 UTC] jaenecke at gmx dot li
Given a file test.ini like
  foo = BAR

and parsing it in parse.php:
  define ( 'BAR', 'just any value' );
  $ini = parse_ini_file ( 'test.ini' );
  print_r ( $ini );

will result in
  Array
  (
      [foo] => just any value
  )

This is maybe a quite useful behaviour but should at least be mentioned in the documentation. 
I would prefer a third argument added to the function which could be used to turn this feature off.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-26 14:34 UTC] jaenecke at gmx dot li
.
 [2002-09-26 15:37 UTC] goba@php.net
Well, this is a feature, this is how E_ constants work in the ini file I guess. This can be useful in many cases, so it definitely needs to be added into the docs.
 [2002-11-19 02:54 UTC] philip@php.net
This is now documented and will show up within the next few days.  The patch can be seen here:

http://cvs.php.net/diff.php/phpdoc/en/reference/filesystem/functions/parse-ini-file.xml?r1=1.6&r2=1.7&ty=h

Thank you for the report!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 17 10:01:28 2024 UTC