function process(, , )
{
foreach ( as ) {
}
}
// create a bunch of math functions
create_function(',', ),
create_function(',', ),
create_function(',', )
);
process(2.3445, M_PI, );
// now make a bunch of string processing functions
);
?>
上例将输出:
Using the first
array of anonymous functions
parameters: 2.3445, M_PI
some trig: -1.6291725057799
a hypotenuse: 3.9199852871011
b*a^2 = 4.8103313314525
min(b^2+a, a^2,b) = 8.6382729035898
ln(a/b) = 0.27122299212594
Using the second
array of anonymous functions
** Look the same to me! (looking at the first 3 chars)
CRCs: -725381282 , 1908338681
similar(a,b) = 11(45.833333333333%)
?>
上例将输出:
Array
(
[0] => the mango
[1] => a mango
[2] => that mango
[3] => this mango
)