Oh, found the answer. usort takes the callback name as a string, so the code should read:
<!DOCTYPE html>
<html>
<body>
<?php
function cb($l1, $l2) {
if($l1 == $l2) return 0;
return ($l1 < $l2) ? -1 : 1 ;
}
$res[0] = 102;
$res[1] = 101;
echo var_dump($res);
echo "<br>";
usort($res, "cb"); // notice the quotes around "cb"
echo var_dump($res);
?>
</body>
</html>
I read that earlier PHP versions were tolerant and implicitly quoted such calls...