[wp-hackers] Re: How to redirect to login when filtered posts are empty?

Sam Angove sam at rephrase.net
Thu Aug 9 09:30:20 GMT 2007


On 8/9/07, Jeremy Visser <jeremy.visser at gmail.com> wrote:
>
> Sweet! I though only JavaScript could do that!

It's a common pattern in languages where functions are first-class
objects[1] (JavaScript, Python, Ruby, Lisp, Haskell etc.) and
occasionally tacked on to languages where they aren't. C++ has
boost::lambda, for example.

PHP's support is of the tacked-on variety, so it isn't great.
`create_function()` can be useful, but it's basically just an `eval()`
macro[2] -- not quite *evil*, but getting there. Unlike anonymous
functions in JavaScript, you should think twice before using it. :(

[1]: http://www.joelonsoftware.com/items/2006/08/01.html
[2]: http://blog.libssh2.org/index.php?/archives/60-create_function-is-not-your-friend.html


More information about the wp-hackers mailing list