WordPress.org

Make WordPress Core

Opened 11 months ago

Closed 11 months ago

Last modified 11 months ago

#24357 closed defect (bug) (fixed)

Stop suppressing E_DEPRECATED when WP_DEBUG

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

Description

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)

comment:1 nacin11 months 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.

comment:2 nacin11 months 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.

comment:3 follow-up: michelwppi11 months 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
M.

comment:4 in reply to: ↑ 3 SergeyBiryukov11 months 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.

comment:5 iandunn11 months ago

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