@@ -447,9 +447,9 @@ static PHP_INI_MH(OnUpdateTimeout)
447
447
448
448
/* {{{ php_get_display_errors_mode() helper function
449
449
*/
450
- static int php_get_display_errors_mode (char * value , size_t value_length )
450
+ static unsigned int php_get_display_errors_mode (char * value , size_t value_length )
451
451
{
452
- int mode ;
452
+ unsigned int mode ;
453
453
454
454
if (!value ) {
455
455
return PHP_DISPLAY_ERRORS_STDOUT ;
@@ -480,7 +480,12 @@ static int php_get_display_errors_mode(char *value, size_t value_length)
480
480
*/
481
481
static PHP_INI_MH (OnUpdateDisplayErrors )
482
482
{
483
- PG (display_errors ) = (zend_bool ) php_get_display_errors_mode (ZSTR_VAL (new_value ), ZSTR_LEN (new_value ));
483
+ PG (errors_output_stream ) = php_get_display_errors_mode (ZSTR_VAL (new_value ), ZSTR_LEN (new_value ));
484
+ if (PG (errors_output_stream ) > 0 ) {
485
+ PG (display_errors ) = true;
486
+ } else {
487
+ PG (display_errors ) = false;
488
+ }
484
489
485
490
return SUCCESS ;
486
491
}
@@ -490,7 +495,8 @@ static PHP_INI_MH(OnUpdateDisplayErrors)
490
495
*/
491
496
static PHP_INI_DISP (display_errors_mode )
492
497
{
493
- int mode , cgi_or_cli ;
498
+ unsigned int mode ;
499
+ bool cgi_or_cli ;
494
500
size_t tmp_value_length ;
495
501
char * tmp_value ;
496
502
@@ -1342,7 +1348,7 @@ static ZEND_COLD void php_error_cb(int orig_type, const char *error_filename, co
1342
1348
} else {
1343
1349
/* Write CLI/CGI errors to stderr if display_errors = "stderr" */
1344
1350
if ((!strcmp (sapi_module .name , "cli" ) || !strcmp (sapi_module .name , "cgi" ) || !strcmp (sapi_module .name , "phpdbg" )) &&
1345
- PG (display_errors ) == PHP_DISPLAY_ERRORS_STDERR
1351
+ PG (errors_output_stream ) == PHP_DISPLAY_ERRORS_STDERR
1346
1352
) {
1347
1353
fprintf (stderr , "%s: %s in %s on line %" PRIu32 "\n" , error_type_str , ZSTR_VAL (message ), error_filename , error_lineno );
1348
1354
#ifdef PHP_WIN32
0 commit comments