Skip to content

Commit 80250da

Browse files
committed
Promote warning to exception in parse_ini_file() function
1 parent e6b3915 commit 80250da

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
@@ -3852,8 +3852,8 @@ PHP_FUNCTION(parse_ini_file)
38523852
ZEND_PARSE_PARAMETERS_END();
38533853

38543854
if (filename_len == 0) {
3855-
php_error_docref(NULL, E_WARNING, "Filename cannot be empty!");
3856-
RETURN_FALSE;
3855+
zend_value_error("Filename cannot be empty!");
3856+
return;
38573857
}
38583858

38593859
/* Set callback function */

ext/standard/basic_functions.stub.php

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

358358
function move_uploaded_file(string $path, string $new_path): bool {}
359359

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

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

0 commit comments

Comments
 (0)