php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #34354 parse_ini_file interprets "null" as empty string
Submitted: 2005-09-03 03:53 UTC Modified: 2005-09-05 11:02 UTC
From: php dot net at sharpdreams dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 5CVS-2005-09-03 (snap) OS: Win32
Private report: No CVE-ID: None
 [2005-09-03 03:53 UTC] php dot net at sharpdreams dot com
Description:
------------
The documentation is unclear on this aspect so I am presuming this is a bug:

Keys in INI files set to null (no quotes) are parsed as empty string "" instead of a true null.

If this is intended behavior then it should be documented as such.

Reproduce code:
---------------
-- test.ini --
[foo]
bar = null

-- test.php --
var_dump( parse_ini_file( "test.ini" ) );

Expected result:
----------------
array(1) {
  ["foo"]=>
  NULL
}

Actual result:
--------------
array(1) {
  ["foo"]=>
  string(0) ""
}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-05 00:09 UTC] sniper@php.net
reclassified

 [2005-09-05 11:02 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

"Values null, no and false results in "", yes and true results in "1"."
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 15 17:01:33 2025 UTC