in reply to Evaluates two array index

Actually, cristian just posted an obfu that uses something very, very similar to what you want :-)

You might learn something from looking at his code (it's obfu-ed, but not so much that you won't understand it).