I'd like to call a comparison function that's defined within a class in static fashion, in PHP4. Example code:
Trying to call the function with Test::cmp_function however gives the error Parse error: syntax error, unexpected ')', expecting '('. And commenting that line out and uncommenting the object-oriented lines gives the warning Warning: usort() [function.usort]: Invalid comparison function.Code:$array = array(100, 40, 120, 125, 110, 60); usort($array, Test::cmp_function); //$test = new Test(); //usort($array, $test->cmp_function); print_r($array); class Test { function cmp_function($a, $b) { return ($a>$b); } }
How can I call the Test::cmp_function comparison function?





Bookmarks