PHP Anonymous Functions: What Are They, and Why Use Them?

  You are currently not logged in. You can view the forums, but cannot post messages. Log In | Register

10-Dec-12 00:00
This is a forum topic for discussing the article "PHP Anonymous Functions: What Are They, and Why Use Them?":

http://www.elated.com/articles/php-anonymous-functions/

Learn how to create and use anonymous functions, callbacks and closures in PHP.
10-Dec-12 22:42
Thanks for article...
Some of it is a bit over my head, but I get the general gist!
One thing that has me confused is the usort example.
Should this line:
return ( $personA["age"] < $personB["age"] ) ? -1 : 1;
Have "name" for $personA ?
Cheers, Dave
11-Dec-12 13:39
name??

That line is the equvalent of



<?php>
if($A < $B) {
return -1;
} else {
return 1;
}
?>


--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/

 
New posts
Old posts

Follow Elated