Skip to content

Promote warnings to exceptions in the standard lib #4937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
441b326
Promote warning to exception in log() function
kocsismate Nov 20, 2019
ee3b345
Promote warning to exception in ini_get_all() function
kocsismate Nov 20, 2019
e5a8bae
Promote warning to exception in parse_ini_file() function
kocsismate Nov 20, 2019
c30e234
Promote warnings to exceptions in dl() function
kocsismate Nov 20, 2019
9b4cf61
Promote warnings to exceptions in password_*() functions
kocsismate Nov 20, 2019
7adf0ce
Promote warning to exception in get_browser() function
kocsismate Nov 20, 2019
b550ea3
Promote warning to exception in dns_check_record() function
kocsismate Nov 20, 2019
716c677
Promote warning to exception in convert_uudecode() function
kocsismate Nov 20, 2019
d2d9f6f
Promote warnings to exceptions in settype() function
kocsismate Nov 20, 2019
2895a86
Promote warrnings to exceptions in chgrp() function
kocsismate Nov 20, 2019
174cb29
Promote warning to exception in constant() function
kocsismate Nov 20, 2019
1833afc
Promote warning to exception in file_get_contents() function
kocsismate Nov 20, 2019
b87ecf3
Promote warnings to exceptions in proc_open() function
kocsismate Nov 20, 2019
b610f2e
Capitalize the initial letter of the error message of htmlspecialchar…
kocsismate Nov 20, 2019
b2b219c
Promote warning to exception in the levenshtein() function
kocsismate Nov 20, 2019
474bbc6
Promote warnings to exceptions in some URL and file related functions
kocsismate Nov 20, 2019
bc6bb44
Promote warnings to exceptions in string search related functions
kocsismate Nov 20, 2019
49b87c0
Promote warnings to exceptions in *scanf() functions
kocsismate Nov 20, 2019
5025c88
Promote warning to exception in the convert_uudecode() function
kocsismate Nov 20, 2019
023f629
Promote warnings to exceptions in register_shutdown_handler() function
kocsismate Nov 20, 2019
ddd8362
Promote warnings to exceptions in register_tick_function() function
kocsismate Nov 20, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ext/standard/basic_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -4214,8 +4214,8 @@ PHP_FUNCTION(parse_ini_file)
ZEND_PARSE_PARAMETERS_END();

if (filename_len == 0) {
php_error_docref(NULL, E_WARNING, "Filename cannot be empty!");
RETURN_FALSE;
zend_value_error("Filename cannot be empty!");
return;
}

/* Set callback function */
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/basic_functions.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ function is_uploaded_file(string $path): bool {}

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

function parse_ini_file(string $filename, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array {}
function parse_ini_file(string $filename, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array|false {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this change the wrong way around?

Copy link
Member Author

@kocsismate kocsismate Dec 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it's not, because as far as I saw parse_ini_file() can also return false:

RETURN_FALSE;


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

Expand Down