[wp-trac] [WordPress Trac] #10264: wp-includes E_STRICT errors

WordPress Trac wp-trac at lists.automattic.com
Wed Jun 24 23:44:46 GMT 2009


#10264: wp-includes E_STRICT errors
--------------------------+-------------------------------------------------
 Reporter:  Mittineague   |       Owner:  Denis-de-Bernardy
     Type:  defect (bug)  |      Status:  new              
 Priority:  low           |   Milestone:  Unassigned       
Component:  Performance   |     Version:  2.8              
 Severity:  normal        |    Keywords:                   
--------------------------+-------------------------------------------------
 My Error Reporting plugin broke with 2.8 in part because of an extreme
 number of errors (mostly simplepie "non-static called staticly" errors).

 But there is also a problem with errors in Core files i.e. is_a()

 True they are only E_STRICT deprecated errors and is_a() is un-deprecated
 in PHP 5.3.0 and it may be more trouble than it's worth to handle the
 differences for PHP < 5.0, PHP 5.0, PHP 5.1+

 I have PHP 5.2.6 so I didn't need the "fatal error" work-around, but I
 made changes similar to
 {{{
 //      if ( !is_a($wp_scripts, 'WP_Scripts') )
         $wp_scripts_string = 'WP_Scripts';
         if ( !($wp_scripts instanceof $wp_scripts_string) )
 }}}
 in the following wp-includes files
 {{{
 wp-includes/class-feed.php [1 fix]
 wp-includes/class-IXR.php [5 fixes]
 wp-includes/classes.php [1 fix]
 wp-includes/functions.wp-scripts.php [6 fixes]
 wp-includes/functions.wp-styles.php [5 fixes]
 wp-includes/general-template.php [1 fix]
 wp-includes/script-loader.php [4 fixes]
 }}}
 Of particular note is the classes.php file which literally throws hundreds
 of errors per page on my blog.
 {{{
 function is_wp_error($thing) {
 //      if ( is_object($thing) && is_a($thing, 'WP_Error') )
         $wp_error_string = 'WP_Error';
         if ( is_object($thing) && ($thing instanceof $wp_error_string) )
 }}}
 And I may be off, but the functions.wp-styles.php file has a function that
 looks suspicious
 {{{
 function wp_style_is( $handle, $list = 'queue' ) {
 .....
 //      if ( !is_a($wp_styles, 'WP_Scripts') )
         $wp_scripts_string = 'WP_Scripts';
         if ( !($wp_styles instanceof $wp_scripts_string) )
 }}}
 i.e. if $wp_styles is not a WP_Scripts it becomes a WP_Styles

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10264>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list