Replace a one-off function-in-function with an anonymous function

Bug #1185693 reported by Aaron Wells
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
In Progress
Low
Unassigned

Bug Description

It does provide slightly better performance to use a standalone function, but using an anonymous function avoids the possibility of namespace collisions and arguably makes the intention of the code more readable.

Revision history for this message
Robert Lyon (robertl-9) wrote :

Are you meaning the use of create_function() that is peppered thru mahara code? As I noticed that PHP.net says:

Caution: This function internally performs an eval() and as such has the same security issues as eval(). Additionally it has bad performance and memory usage characteristics. If you are using PHP 5.3.0 or newer a native anonymous function should be used instead.

So I guess we should convert those to anonymous functions soon

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.