[wp-trac] [WordPress Trac] #50227: Contant for error_reporting

WordPress Trac noreply at wordpress.org
Fri May 22 17:29:10 UTC 2020


#50227: Contant for error_reporting
----------------------------+------------------------
 Reporter:  hannesd         |       Owner:  (none)
     Type:  enhancement     |      Status:  closed
 Priority:  normal          |   Milestone:
Component:  Bootstrap/Load  |     Version:  trunk
 Severity:  normal          |  Resolution:  duplicate
 Keywords:                  |     Focuses:
----------------------------+------------------------
Changes (by SergeyBiryukov):

 * keywords:  needs-patch =>
 * status:  new => closed
 * resolution:   => duplicate
 * milestone:  Awaiting Review =>


Old description:

> In wp_load.php wp_debug_mode() error_reporting is set to E_ALL, when
> WP_DEBUG is set to true. E_ALL is not the best choice in all situations.
> I would like to have a constant, where I can set a error_reporting to a
> different value.
>
> if ( WP_DEBUG ) {
>     if ( defined( 'WP_DEBUG_ERROR_REPORTING' ) ) {
>         error_reporting( WP_DEBUG_ERROR_REPORTING );
>     } else {
>         error_reporting( E_ALL );
>     }
>     ...
>
> The constant can then be defined in wp_config.php
> define( 'WP_DEBUG_ERROR_REPORTING', E_ALL & ~E_NOTICE & ~E_DEPRECATED |
> E_STRICT );

New description:

 In wp_load.php wp_debug_mode() error_reporting is set to E_ALL, when
 WP_DEBUG is set to true. E_ALL is not the best choice in all situations. I
 would like to have a constant, where I can set a error_reporting to a
 different value.
 {{{
 if ( WP_DEBUG ) {
     if ( defined( 'WP_DEBUG_ERROR_REPORTING' ) ) {
         error_reporting( WP_DEBUG_ERROR_REPORTING );
     } else {
         error_reporting( E_ALL );
     }
     ...
 }}}
 The constant can then be defined in wp_config.php
 define( 'WP_DEBUG_ERROR_REPORTING', E_ALL & ~E_NOTICE & ~E_DEPRECATED |
 E_STRICT );

--

Comment:

 Hi there, welcome to WordPress Trac!

 Thanks for the ticket, we're already tracking this enhancement in #31839.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50227#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list