<?php

function isgreater($a, $b) {
   if($a > $b)
     return 1;
   else 
     return 0;
}

//function only can pass value or reference, eg: function xxx(2, isgreater)
//compare with c programming, php is no datatype define, so the function can pass to it //directly.
function compare($num1, $num2, &$func) {

//$funcpointer = & $func;

//return $funcpointer($num1, $num2);

return $func($num1, $num2);

}

$num1 = 100;
$num2 = 50;


if(compare($num1, $num2, isgreater)) 
printf("num1 is greater than num2");

?>