|
|
|
|
|
by geon
4843 days ago
|
|
In this case it isn't so weird, since PHP pre 5.3 didn't have first class functions. To pass a function around, you would use a variable containing a string of it's name. create_function was a way to A) not having to define a function separately B) not getting problems with the function being re-defined, since each call would create a new function C) fake closures by generating code. All this should be moot points by now, since PHP has real anonymous functions with closures, |
|
But I suppose that goes naturally hand in hand with the cargo cult approach to language design.