PHP Lambda Functions – Anonymous JS-like functions in PHP

PHP 5.3 brought some new interesting stuff, I know its out for a while, but I recently started to love this new functionality. Lambda functions are anonymous functions knows as closures and they are really similar to the closures in JavaScript.

The difference from JS is that variables in the closure don’t have access to variables from outside the function, unless they are brought into the closure by using the “use” keyword.
Continue reading “PHP Lambda Functions – Anonymous JS-like functions in PHP”

Week Calculation in PHP

Working with Dates is always a problem. PHP just has a limited ability to work properly with dates, some things are not so easy too find. The PEAR Library offers a good amound of possibilities to work with dates, but the price is a massive loss of speed.

After searching a while I found 3 useful functions to work with weeks. Which I adapted to my needs.

Continue reading “Week Calculation in PHP”