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:
It is working as of php 5.2.4
$testglobal = ' WORKING '; $topics = array('a','b','c'); function cmp($a, $b) { global $testglobal; echo 'hi' . $testglobal; } usort($topics, "cmp"); // hi WORKING hi WORKING