Jeśli jesteś właścicielem tej strony, możesz wyłączyć reklamę poniżej zmieniając pakiet na PRO lub VIP w panelu naszego hostingu już od 4zł!

Shameer’s Blog: PHP 5.3 : Practical look into Lambda functions and closures

Shameer’s Blog: PHP 5.3 : Practical look into Lambda functions and closures

For those out there still coming to grips with some of what PHP 5.3 has to offer, I’d suggest checking out this new article from Shameer about using lambdas and closures along with some examples putting them into action.

PHP 5.3 packaged the power of functional programming by adding support for lambda functions and closures. You will be familiar with them in javascript. In this article we will have a look into these features and its usages.

He starts with explanations of what they are with simple code examples showing their use – a lambda assigned to a variable and closures with the “use” keyword. He shows how they can be used in application prototyping, making handy callback functions and includes a practical example of finding the factorial of a number using a lambda.

Source: http://www.phpdeveloper.org/news/15658

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Posted Grudzień 31st, 2010 in WEB and PHP Development.

Leave a response: