Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#24357 closed defect (bug) (fixed)

Stop suppressing E_DEPRECATED when WP_DEBUG

Reported by: nacin's profile nacin Owned by: nacin's profile nacin
Milestone: 3.6 Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:


Our current code in wp_debug_mode() is not designed for PHP 5.4. When WP_DEBUG is on, we set the error reporting level to E_ALL minus E_DEPRECATED and minus E_STRICT.

Given that PHP 5.4 has turned many of these E_DEPRECATED situations (such as call-time pass-by-reference) into fatal or parse errors — removing deprecated features as they promised — plugin authors need to know their code will no longer be working.

I don't think it's a bad idea to continue to suppress E_STRICT, though we can make that decision at a later time. If a developer sees too many notices, they're going to ignore all of them. For this, we'll need to do a >= 5.4 check and then lump in E_STRICT, as E_STRICT is *not* included in E_ALL prior to 5.4 (thus our current check is already a little wonky).

Also, core is pretty solid when it comes to both E_STRICT and E_DEPRECATED issues, because we've been testing with the latest versions of PHP for some time now.

Change History (6)

#1 @nacin
11 years ago

Or rather, let's just do E_ALL — and if the user is running 5.4, they'll see E_STRICT. If they're running less than 5.4, they won't.

#2 @nacin
11 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In 24288:

When WP_DEBUG, set PHP error_reporting level to E_ALL. This will include E_DEPRECATED in PHP 5.3, and E_STRICT in PHP 5.4.

fixes #24357.

#3 follow-up: @michelwppi
11 years ago

After updating nighty built just now, I discover this message concerning core WP

Strict Standards: Redefining already defined constructor for class WP_Widget in /Applications/MAMP/htdocs/wp_svn36/wp-includes/widgets.php on line 93

Config : I use PHP 5.4.10 on MAMP localhost with error_reporting level set to E_ALL

Best regards

#4 in reply to: ↑ 3 @SergeyBiryukov
11 years ago

Replying to michelwppi:

Strict Standards: Redefining already defined constructor for class WP_Widget in /Applications/MAMP/htdocs/wp_svn36/wp-includes/widgets.php on line 93

See #20801.

#5 @iandunn
11 years ago

  • Cc ian.dunn@… added
Note: See TracTickets for help on using tickets.