From: glox at glox dot be
Operating system: linux slackware 9.0
PHP version: 5CVS-2003-11-08 (dev)
PHP Bug Type: *General Issues
Bug description: p_ini_file elements bug

Description:
------------
When I load a .ini file with p_ini_file and try to echo the elements
of the array it won't work. The values show up on print_r/var_dump but
can't be echo'd seperately. When I use foreach it finds the elements too.
I tried the same script in php4 on the same pc and it worked fine.

Reproduce code:
---------------
# phpbug.php
<?php
$conf = p_ini_file('config.ini', TRUE);
print_r($conf);
print_r($conf['clientports']);
var_dump($conf['clientports'][0]);
?>

# config.ini
; PHPIRCD Configuration File

; Client ports: you can specify up to 10 ports here, start with 0
[clientports]
0 = 6667
1 = 6668

; Server ports: you can specify up to 10 ports here, start with 0
[serverports]
0 = 4041

Expected result:
----------------
Array
(
[clientports] => Array
(
[0] => 6667
[1] => 6668
)

[serverports] => Array
(
[0] => 4041
)

)
Array
(
[0] => 6667
[1] => 6668
)
NULL

Actual result:
--------------
Array
(
[clientports] => Array
(
[0] => 6667
[1] => 6668
)

[serverports] => Array
(
[0] => 4041
)

)
Array
(
[0] => 6667
[1] => 6668
)
string(4) "6667"

--
Edit bug report at [url]http://bugs.php.net/?id=26176&edit=1[/url]
--
Try a CVS snapshot (php4): [url]http://bugs.php.net/fix.php?id=26176&r=trysnapshot4[/url]
Try a CVS snapshot (php5): [url]http://bugs.php.net/fix.php?id=26176&r=trysnapshot5[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=26176&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=26176&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=26176&r=needtrace[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=26176&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=26176&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=26176&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=26176&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=26176&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=26176&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=26176&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=26176&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=26176&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=26176&r=gnused[/url]
Floating point limitations: [url]http://bugs.php.net/fix.php?id=26176&r=float[/url]