Replace a one-off function-in-function with an anonymous function
Bug #1185693 reported by
Aaron Wells
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.
To post a comment you must log in.
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