[wp-trac] [WordPress Trac] #11663: Return by Referenced missed - PHP4 Compat

WordPress Trac wp-trac at lists.automattic.com
Thu Feb 18 10:15:53 UTC 2010


#11663: Return by Referenced missed - PHP4 Compat
--------------------------+-------------------------------------------------
 Reporter:  hakre         |        Owner:          
     Type:  defect (bug)  |       Status:  reopened
 Priority:  normal        |    Milestone:          
Component:  General       |      Version:  2.9     
 Severity:  normal        |   Resolution:          
 Keywords:  dev-feedback  |  
--------------------------+-------------------------------------------------

Comment(by hakre):

 After a chat with DD32 the result is: It's undocumented / unspecified when
 to return by reference and when not. It depens on the concrete situation
 and a core developer will know when to use it or not.

 An example where it's a need to return by reference is for caching objects
 because otherwise they would be copied on write and it would not be
 possible to write into the cache object.

 Only returning an object in a function is not per-se the requirement to
 return by reference within wordpress.

 [http://hakre.wordpress.com/2010/02/18/references-to-the-max/ For general
 and in depth PHP variable reference related information, I've put a blog
 post online].

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


More information about the wp-trac mailing list