abidibo.net

Posted in "singleton"

Singleton, the PHP way

patterns php programming singleton

I realized that even if the great part of my work consists in programming PHP stuff, I rarely write about PHP in my posts, maybe because I really don't like it?

But today I'll write about a way to implement the singleton pattern with PHP.

This is quite an easy job making use of PHP 5.3.0, thanks to the "Late Static Binding" feature. In particular we'll use the get_called_class method and the static keyword. Notice that ...

read the full post


  • 1

Your Smartwatch Loves Tasker!

Your Smartwatch Loves Tasker!

Now available for purchase!

Featured