fh.type = ZEND_HANDLE_FILENAME;
array_init(return_value);
- zend_parse_ini_file(&fh, 0, scanner_mode, ini_parser_cb, return_value TSRMLS_CC);
+ if (zend_parse_ini_file(&fh, 0, scanner_mode, ini_parser_cb, return_value TSRMLS_CC) == FAILURE) {
+ zend_hash_destroy(Z_ARRVAL_P(return_value));
+ efree(Z_ARRVAL_P(return_value));
+ RETURN_FALSE;
+ }
}
/* }}} */
$file_path = dirname(__FILE__);
-$parse_string = <<<EOD
+$parse_string = (binary) <<<EOD
; Comment starts with semi-colon(;)
; Section starts with [<section name>]
-- Testing parse_ini_file() function with more than expected no. of arguments --
Warning: parse_ini_file(%s): failed to open stream: No such file or directory in %s on line %d
-array(0) {
-}
+bool(false)
-- Testing parse_ini_file() function with a non-existent file --
Warning: parse_ini_file(%s): failed to open stream: No such file or directory in %s on line %d
-array(0) {
-}
+bool(false)
Done
[u"dqstring"]=>
unicode(46) "asdadfsdjkslkj ¡@£$$ { } !^~|¥¥{[()/)&/% ¤ # #"
[u"php_constant"]=>
- unicode(5) "16383"
+ unicode(5) "32767"
[u"user_constant"]=>
unicode(21) "this_is_test_constant"
}
[u"dqstring"]=>
unicode(34) "asdadfsdjkslkj ¡@£$$€¥¥{[()/)&/%#¤"
[u"php_constant"]=>
- unicode(5) "16383"
+ unicode(5) "32767"
}
[u"comments"]=>
array(1) {
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) {
-}
+bool(false)
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) {
-}
+bool(false)
array(1) {
["test"]=>
string(0) ""
Warning: parse error in %s on line %d
in %s on line 20
-array(1) {
- ["test"]=>
- string(0) ""
-}
+bool(false)
Warning: parse error in %s on line %d
in %s on line 26
-array(1) {
- ["test"]=>
- string(4) "test"
-}
+bool(false)
array(1) {
["test"]=>
string(8) "new
bool(false)
Warning: parse_ini_file(%sparse_ini_file.dat): failed to open stream: No such file or directory in %sparse_ini_file.php on line 8
-array(0) {
-}
+bool(false)
Warning: parse_ini_file(%sparse_ini_file.dat): failed to open stream: No such file or directory in %sparse_ini_file.php on line 9
-array(0) {
-}
+bool(false)
array(1) {
[u"test"]=>
unicode(0) ""
Warning: %s error%sin %sparse_ini_file.dat on line 2
in %sparse_ini_file.php on line 20
-array(1) {
- [u"test"]=>
- unicode(0) ""
-}
+bool(false)
Warning: %serror%sin %sparse_ini_file.dat on line 2
in %sparse_ini_file.php on line 26
-array(1) {
- [u"test"]=>
- unicode(4) "test"
-}
+bool(false)
array(1) {
[u"test"]=>
unicode(8) "new