[wp-trac] [WordPress Trac] #10861: wpdb constructor and desctructor concept is broken

WordPress Trac wp-trac at lists.automattic.com
Sat Sep 26 13:43:33 UTC 2009


#10861: wpdb constructor and desctructor concept is broken
--------------------------+-------------------------------------------------
 Reporter:  hakre         |       Owner:            
     Type:  defect (bug)  |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  General       |     Version:  2.8.4     
 Severity:  normal        |    Keywords:            
--------------------------+-------------------------------------------------
 I assume this once was a try to have a descructor implementation for PHP 4
 as well. But the way the destructor was registered in the constructor is
 broken. Even PHP 5 registeres a shutdown function (the destructor) while
 the ''real'' implementation is already in there.

 Therefore register shutdown function is only needed in PHP 4. The provided
 patch reflects that (partially).

 Then it is plain wrong to have a PHP 5 destructor return a value. It
 returns void by definition. This is properly reflected in the patch now.
 BTW, having a return value on a shutdown function is pretty useless.

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


More information about the wp-trac mailing list