[wp-trac] [WordPress Trac] #11518: Fatal error: Call to undefined method WP_Error::__destruct()

WordPress Trac wp-trac at lists.automattic.com
Tue Feb 16 17:58:48 UTC 2010


#11518: Fatal error: Call to undefined method WP_Error::__destruct()
----------------------------+-----------------------------------------------
 Reporter:  westi           |        Owner:          
     Type:  defect (bug)    |       Status:  reopened
 Priority:  normal          |    Milestone:  2.9.1   
Component:  Administration  |      Version:  2.9     
 Severity:  normal          |   Resolution:          
 Keywords:                  |  
----------------------------+-----------------------------------------------
Changes (by hakre):

  * status:  closed => reopened
  * resolution:  fixed =>


Comment:

 Replying to [comment:26 miqrogroove]:
 > Replying to [comment:24 hakre]:
 > > Just to add a counter-point from the other direction:
 > >
 > > It is bad practice to use the magic function {{{__destruct()}}} for
 any other purpose than the intended one.
 >
 > I believe that's a misinterpretation of the docs.  What the PHP docs say
 literally is not to use function names beginning with __ unless you want
 the magic behavior for that function.  I've never seen anything that says
 you can't or shouldn't call on a magic function.

 I just did wrote what I did wrote, no need to misread it or to add
 something else to it:

 > It is bad practice to use the magic function {{{__destruct()}}} for any
 other purpose than the intended one.

 That's what I'm concerned about. The intended purpose of
 {{{__destruct()}}} is the one that it get's called by the PHP garbage
 collector whenever the GC seems it fit to call that function. For example
 this must not be related to a specific unset operation.

 If you want to clean up circular references as discussed in #11597 as
 well, that function is just not fitting for clearing up memory precisely
 nor is that the defined intention.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11518#comment:27>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list