|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-06-28 03:05 UTC] asonge@php.net
Description:
------------
an ini file with no trailing newline will result in "Parse error", php5.3 only, 5.2 parses the file fine
Reproduce code:
---------------
$ echo -n "foo.bar = baz" > test.ini
$ /opt/php53/bin/php -r 'var_dump(parse_ini_file("test.ini"));'
Expected result:
----------------
array(1) {
["foo.bar"]=>
string(3) "baz"
}
Actual result:
--------------
Warning: syntax error, unexpected $end in test.ini on line 1
in Command line code on line 1
Call Stack:
0.0003 312916 1. {main}() Command line code:0
0.0128 312936 2. parse_ini_file() Command line code:1
array(0) {
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 03:00:02 2025 UTC |
$ echo -n "foo.bar = baz " > test.ini 20:46 alex@asonge:~ $ /opt/php53/bin/php -r 'var_dump(parse_ini_file("test.ini"));' array(1) { ["foo.bar"]=> string(4) "baz " } so the answer is, yes, a trailing space does not cause the error...if this needs to be marked as a duplicate, whatever it takes to get this working the same as php<=5.2