Uh oh!
There was an error while loading. Please reload this page.
Promote warnings to exceptions in the standard lib - #4937
Conversation
1709d41 to
19a2cc3CompareUh oh!
There was an error while loading. Please reload this page.
Girgias
left a comment
There was a problem hiding this comment.
I'm not exactly sure if the ones related to files/ftp should be changed to Errors so I'll hand of the decision to somebody more knowledgable.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Girgias
commented
Nov 20, 2019
Test failures are legit, mostly about fscanf which need to be updated. |
5611f2b to
b0de09aCompare1ad3b16 to
2e15b92Compare2e15b92 to
ddd8362Comparekocsismate
commented
Nov 22, 2019
Huh, finally the tests are going to be green after my latest fix... |
| 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 {} |
There was a problem hiding this comment.
Isn't this change the wrong way around?
There was a problem hiding this comment.
I believe it's not, because as far as I saw parse_ini_file() can also return false:
php-src/ext/standard/basic_functions.c
Line 4236 in 2adb1bb
nikic
commented
Dec 5, 2019
A lot in here that is not very clear-cut... Feel free to already commit the log and settype changes, and the htmlspecialchars capitalization fix. |
nikic
commented
Dec 5, 2019
The file_get_contents change is fine as well. |
| @@ -618,7 +618,7 @@ PHPAPI int php_sscanf_internal( char *string, char *format, | |||
| if (numVars) { | |||
| for (i = varStart;i < argCount;i++){ | |||
| if ( ! Z_ISREF(args[ i ] ) ) { | |||
There was a problem hiding this comment.
Convert this into ZEND_ASSERT(Z_ISREF(args[i])), it should never fail.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| zend_string *function_name | ||
| = zend_get_callable_name(&shutdown_function_entry->arguments[0]); | ||
| php_error(E_WARNING, "(Registered shutdown functions) Unable to call %s() - function does not exist", ZSTR_VAL(function_name)); | ||
| zend_value_error("(Registered shutdown functions) Unable to call %s() - function does not exist", ZSTR_VAL(function_name)); |
There was a problem hiding this comment.
A potential problem here is that this warnings is triggered during shutdown, so there is actually no way to catch the exception. Maybe that's okay though, I'm not sure.
kocsismate
commented
Dec 5, 2019
Thanks Nikita for the review! I admit, these changes only seemed "clear cut" for the first sight. I believe though that warning promotions for the |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
nikic
commented
Dec 6, 2019
@kocsismate chgrp is fine modulo two nits. password_* will require corresponding changes in ext/sodium, some of the code is duplicated there. |
nikic
commented
Dec 10, 2019
Btw, I'm not saying the rest here can't land, I just didn't review it in detail. I can take another look after a rebase. |
OK, sorry, I misunderstood your words a little bit. I've just rebased to current master (I hope it worked :S). |
I tried to choose warnings where promotion didn't seem problematic. I committed all the promotions separately, but I can also
explode()the PR into smaller ones.