Our Recent Articles


Decorating PHP classes without a common ancestor

The decorator pattern is commonly described as a pair of classes—a component and a decorator—which derive from a common ancestor. Using language-level features in PHP, we can relax this restriction and still reap the benefits of runtime object-behavior modification. To change the functionality of the component, the decorator redefines one or more methods. Within these […]

3d Vector illustration of a lock icon

Anonymous functions and closure in PHP

PHP 5.3 introduced function literals to the language, providing big benefits in the form of syntax and readability when using and creating functions that accept other functions as arguments. However, the introduction of anonymous functions was paired with another useful language construct which allows us to close over local variables in the same scope as […]


Anonymous recursion in PHP

The scenario You’re neck deep in 3-year old production code, amazon one-click checkout isn’t working, and your wife just left you for someone who “doesn’t spend so much time writing unit tests.” You need to save the world by implementing an algorithm using an anonymous function now. Wait, what if the problem you need to […]

See all our news