Different how..? And more importantly: WHY?

--Jani


Pierre-Alain Joye wrote:
pajoye          Thu Aug 21 13:05:10 2008 UTC

  Added files:                 (Branch: PHP_5_3)
    /php-src/ext/standard/tests/general_functions       
parse_ini_file-win32.phpt Modified files: /php-src/ext/standard/tests/general_functions parse_ini_file.phpt Log:
  - MFH: different parser message on windows
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/parse_ini_file.phpt?r1=1.1.2.2.2.3&r2=1.1.2.2.2.4&diff_format=u
Index: php-src/ext/standard/tests/general_functions/parse_ini_file.phpt
diff -u 
php-src/ext/standard/tests/general_functions/parse_ini_file.phpt:1.1.2.2.2.3 
php-src/ext/standard/tests/general_functions/parse_ini_file.phpt:1.1.2.2.2.4
--- 
php-src/ext/standard/tests/general_functions/parse_ini_file.phpt:1.1.2.2.2.3    
    Sun Aug 17 21:55:26 2008
+++ php-src/ext/standard/tests/general_functions/parse_ini_file.phpt    Thu Aug 
21 13:05:10 2008
@@ -1,5 +1,7 @@
 --TEST--
 parse_ini_file() multiple calls
+--SKIPIF--
+<?php if( substr(PHP_OS, 0, 3) == 'WIN' ) die("skip Windows has different error 
message");?>
 --FILE--
 <?php
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/parse_ini_file-win32.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/general_functions/parse_ini_file-win32.phpt
+++ php-src/ext/standard/tests/general_functions/parse_ini_file-win32.phpt
--TEST--
parse_ini_file() multiple calls
--SKIPIF--
<?php if( substr(PHP_OS, 0, 3) != 'WIN' ) die("skip non Windows systems have different 
error message");?>
--FILE--
<?php

$filename = dirname(__FILE__)."/parse_ini_file.dat";
@unlink($filename); /* Make sure the file really does not exist! */

var_dump(parse_ini_file());
var_dump(parse_ini_file(1,1,1,1));
var_dump(parse_ini_file($filename));
var_dump(parse_ini_file($filename, true));

$ini = "
test =
";
file_put_contents($filename, $ini);
var_dump(parse_ini_file($filename));
$ini = "
test==
";
file_put_contents($filename, $ini);
var_dump(parse_ini_file($filename));

$ini = "
test=test=
";
file_put_contents($filename, $ini);
var_dump(parse_ini_file($filename));

$ini = "
test= \"new
line\"
";
file_put_contents($filename, $ini);
var_dump(parse_ini_file($filename));

define("TEST_CONST", "test const value");
$ini = "
test=TEST_CONST
";
file_put_contents($filename, $ini);
var_dump(parse_ini_file($filename));

$ini = "
[section]
test=hello
";
file_put_contents($filename, $ini);
var_dump(parse_ini_file($filename, true));

$ini = "
[section]
test=hello
";
file_put_contents($filename, $ini);
var_dump(parse_ini_file($filename, false));

$ini = "
section.test=hello
";
file_put_contents($filename, $ini);
var_dump(parse_ini_file($filename, true));

$ini = "
[section]
section.test=hello
";
file_put_contents($filename, $ini);
var_dump(parse_ini_file($filename, true));

$ini = "
[section]
1=2
";
file_put_contents($filename, $ini);
var_dump(parse_ini_file($filename, true));

$ini = "
1=2
";
file_put_contents($filename, $ini);
var_dump(parse_ini_file($filename, true));
$ini = "
test=test2
test=test3
test=test4
";
file_put_contents($filename, $ini);
var_dump(parse_ini_file($filename, true));

/* From bug #44574 */
$ini = "[section1]\nname = value";
file_put_contents($filename, $ini);
var_dump(parse_ini_file($filename, true));

/* #44842, labels starting with underscore */
$ini = <<<'INI'
foo=bar1
_foo=bar2
foo_=bar3
INI;
file_put_contents($filename, $ini);
var_dump(parse_ini_file($filename, true));

@unlink($filename);
echo "Done\n";
?>
--EXPECTF--     
Warning: parse_ini_file() expects at least 1 parameter, 0 given in %s on line 6
bool(false)

Warning: parse_ini_file() expects at most 3 parameters, 4 given in %s on line 7
bool(false)

Warning: parse_ini_file(%sparse_ini_file.dat): failed to open stream: No such 
file or directory in %s.php on line 8
array(0) {
}

Warning: parse_ini_file(%sparse_ini_file.dat): failed to open stream: No such 
file or directory in %s.php on line 9
array(0) {
}
array(1) {
  ["test"]=>
  string(0) ""
}

Warning: parse error in %s on line %d
 in %s on line 20
array(1) {
  ["test"]=>
  string(0) ""
}

Warning: parse error in %s on line %d
 in %s on line 26
array(1) {
  ["test"]=>
  string(4) "test"
}
array(1) {
  ["test"]=>
  string(8) "new
line"
}
array(1) {
  ["test"]=>
  string(16) "test const value"
}
array(1) {
  ["section"]=>
  array(1) {
    ["test"]=>
    string(5) "hello"
  }
}
array(1) {
  ["test"]=>
  string(5) "hello"
}
array(1) {
  ["section.test"]=>
  string(5) "hello"
}
array(1) {
  ["section"]=>
  array(1) {
    ["section.test"]=>
    string(5) "hello"
  }
}
array(1) {
  ["section"]=>
  array(1) {
    [1]=>
    string(1) "2"
  }
}
array(1) {
  [1]=>
  string(1) "2"
}
array(1) {
  ["test"]=>
  string(5) "test4"
}
array(1) {
  ["section1"]=>
  array(1) {
    ["name"]=>
    string(5) "value"
  }
}
array(3) {
  ["foo"]=>
  string(4) "bar1"
  ["_foo"]=>
  string(4) "bar2"
  ["foo_"]=>
  string(4) "bar3"
}
Done





--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to