Table of contents Home page
$fname = create_function('$a,$b', 'return(($a+$b)/2);'); echo 'A function with the name', $fname, " has been created.\n"; $a = 8; $b = 9; echo "The average of $a and $b is ", $fname($a, $b), ".\n"; // Since PHP 5.3.0 create_function is obsolete! // The following alternative is to be preferred: /* $fname = function($a, $b) { return ($a + $b) / 2; }; */