[wp-trac] [WordPress Trac] #33933: Avoid PHP 4 warnings for PHP 5

WordPress Trac noreply at wordpress.org
Sun Sep 20 14:34:49 UTC 2015


#33933: Avoid PHP 4 warnings for PHP 5
--------------------------+----------------------
 Reporter:  nmeiser       |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  lowest        |   Milestone:
Component:  Widgets       |     Version:  4.3
 Severity:  trivial       |  Resolution:  invalid
 Keywords:                |     Focuses:
--------------------------+----------------------

Comment (by knutsp):

 I may misunderstand your point, but ...

 Replying to [comment:2 nmeiser]:
 > Well, then tell me why I have to see the warning message with php
 5.4.12, so that I can't navigate through the backend because menu jumps
 down to not scrollable area?

 If you see them it's because
 1. You have a theme or a  plugin that use the deprecated function, and
 2. Your PHP environment is set up with ini directive `display_errors` set
 to on

 Contact the author of the offending plugin and/or `display_errors` to off
 either in your host's server configuration for PHP, `.htaccess`,
 `php.ini`, `.user.ini` or `wp-config.php`.
 Errors should not be displayed on sites "in production". If you need them,
 set up PHP `error_log` or use `WP_DEBUG` with error logging. Errors and
 warnings are for developers, not users.

 > When plugins use $this->WP_Widget(....) it's totally ok and not php4
 style!

 Yes, it's legal in PHP 5 for BC reasons since `__construct()` was
 introduced. No, it's not ok because WordPress may have to remove the
 function in a future release because it, accordong to the PHP roadmap, som
 day will not work with the latest PHP.

 > If Wordpress will not allow PHP4 than remove the methode!!

 That could lead to fatal errors and break sites. Deprecation is telling
 developers to stop using the method.

 See [https://make.wordpress.org/core/2015/07/02/deprecating-php4-style-
 constructors-in-wordpress-4-3/]

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


More information about the wp-trac mailing list