I\'m trying to do a usort in PHP, but I can\'t access global variables inside a usort function.
I\'ve simplified my code down to bare bones to show what I mean:
Can't reproduce the "error" and neither can codepad: http://codepad.org/5kwctnDP
You could also use object properties instead of global variables
test; return strcmp($a, $b); } } $topics = array(1,2,3); $foo = new Foo; usort($topics, array($foo, 'bar'));