understanding lambda

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Trying to wrap my head around the lambda concept.

I saw this example on the php website:

$func = function($value) { return $value * 2; };
print_r(array_map($func, range(1, 5)));

Which led me to conclude this definition

"A lambda function is a function whose name is a variable, rather than
a hard-coded string."

Is this correct?

Re: understanding lambda

lawpoop wrote:
Quoted text here. Click to load it

Answered in alt.php.

Please do not multipost.  If you must post to multiple newsgroups,
please crosspost instead.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Site Timeline