[wp-trac] [WordPress Trac] #14424: Eliminate dynamic function definitions, ie create_function

WordPress Trac wp-trac at lists.automattic.com
Mon Jul 26 23:05:10 UTC 2010


#14424: Eliminate dynamic function definitions, ie create_function
-------------------------+--------------------------------------------------
 Reporter:  ScottMac     |       Owner:                 
     Type:  enhancement  |      Status:  new            
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  General      |     Version:  3.0            
 Severity:  normal       |    Keywords:                 
-------------------------+--------------------------------------------------
 create_function() calls are essentially a form of eval() where the body of
 the functions is defined at runtime rather than compile time. This patch
 removes all but one of the calls within the translation code.

 There are a few reasons for doing this, one is apc can't cache the results
 of the function definition and secondly HipHop doesn't support complex
 create_function definitions.

 Most of the references were array_filter / array_map and replaced with a
 simple foreach.

 Others were sorting and a callback function was added.

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


More information about the wp-trac mailing list