I have some old code that isn't working:
PHP Code:
function($str) { return '.'.$str; }
Context:
PHP Code:
array_map((function($str) { return '.'.$str; }),$array))
My server is currently running PHP 5.2.17. The old one was probably version 4. I don't remember, and it's been a while.
I can certainly work around this on my own, but I'm wondering if there's a proper/recommended method to fix this in general. It comes up once in a while.
Edit: Ah. I must have gone BACK a version. It was probably 5.3 before, now 5.2, without anonymous functions. It looks like create_function() is my best option?
I should get my host to update PHP I guess....
Bookmarks