Skip to content

Commit e5a8bae

Browse files
committed
Promote warning to exception in parse_ini_file() function
1 parent ee3b345 commit e5a8bae

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ext/standard/basic_functions.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4214,8 +4214,8 @@ PHP_FUNCTION(parse_ini_file)
42144214
ZEND_PARSE_PARAMETERS_END();
42154215

42164216
if (filename_len == 0) {
4217-
php_error_docref(NULL, E_WARNING, "Filename cannot be empty!");
4218-
RETURN_FALSE;
4217+
zend_value_error("Filename cannot be empty!");
4218+
return;
42194219
}
42204220

42214221
/* Set callback function */

ext/standard/basic_functions.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ function is_uploaded_file(string $path): bool {}
361361

362362
function move_uploaded_file(string $path, string $new_path): bool {}
363363

364-
function parse_ini_file(string $filename, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array {}
364+
function parse_ini_file(string $filename, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array|false {}
365365

366366
function parse_ini_string(string $ini_string, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array|false {}
367367

0 commit comments

Comments
 (0)