ID:               51094
 Updated by:       j...@php.net
 Reported By:      viaujoc at videotron dot ca
-Status:           Open
+Status:           Bogus
 Bug Type:         Filesystem function related
 Operating System: Win2003
 PHP Version:      5.3.1
 New Comment:

1. There is no such thing as raw scanning in PHP 5.2
2. This is exactly how it's supposed to work. The ; is still comment
even in the raw mode. All other chars are considered just chars.
3. In PHP 5.3 the backslash inside double quotes is considered escape
char. No bug here either. Use single quotes instead.


Previous Comments:
------------------------------------------------------------------------

[2010-02-19 22:10:16] viaujoc at videotron dot ca

Description:
------------
When using parse_ini_file() function with
$scanner_mode=INI_SCANNER_RAW, any semi-colon (;) in the value is seen
as the end of the value, even if it is enclosed in quotes.

The behavior of parse_ini_file() in PHP 5.3 with either $scanner_mode
at RAW or NORMAL cannot reproduce the  behavior of PHP 5.2.

Reproduce code:
---------------
test.ini:
[TheSection]
MyKey="my;value\$"

example.php:
<?php
var_dump(parse_ini_file("test.ini",true,INI_SCANNER_RAW));
?>

Expected result:
----------------
array(1) {
  ["TheSection"]=>
  array(1) {
    ["MyKey"]=>
    string(10) "my;value\$"
  }
}

Actual result:
--------------
In PHP 5.2 (without the $scanner_mode parameter in parse_ini_file()):
array(1) {
  ["TheSection"]=>
  array(1) {
    ["MyKey"]=>
    string(10) "my;value\$"
  }
}
(the value is returned exactly as it appears in test.ini)

In PHP 5.3 (with $scanner_mode=INI_SCANNER_RAW):
array(1) {
  ["TheSection"]=>
  array(1) {
    ["MyKey"]=>
    string(3) ""my"
  }
}
(notice that everything after the semi-colon has been truncated and the
quote as the first character of the string)

In PHP 5.3 (with $scanner_mode=INI_SCANNER_NORMAL):
array(1) {
  ["TheSection"]=>
  array(1) {
    ["MyKey"]=>
    string(9) "my;value$"
  }
}
(notice the missing backslash (\) between the "e" and "$")


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=51094&edit=1

Reply via email to