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ł!

Fabian Schmengler’s Blog: Anonymous function calls in PHP

Fabian Schmengler’s Blog: Anonymous function calls in PHP

Fabian Schmengler has a new post today looking a using anonymous function calls in PHP. He relates to to another popular language that allows for dynamic anonymous functions – Javascript.

Anonymous function calls are a well-known pattern in JavaScript but there are also use cases in PHP where they make sense. Of course PHP 5.3 with its Lambda Functions is required!

He includes several little code snippets showing how the anonymous functions work including the “use” keyword functionality that lets you import variables from outside the function. There’s a sneaky pass-by-reference in there, so don’t get tripped up.

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

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

Posted Luty 26th, 2011 in WEB and PHP Development.

Leave a response: