News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Eric Hogue's Blog:
Late Static Binding
April 22, 2011 @ 09:14:34

Eric Hogue has a recent post to his blog looking at one of the more tricky aspects of the latest versions of PHP (the 5.3.x series) - late static binding. In a nutshell, late static binding (LSB) lets static classes and methods work more correctly than before. Eric gets into a bit more detail than that:

It came out almost 2 years ago, but it to me that many programmers around me have no idea about it. Myself, I have learned about it around 6 months ago. The PHP documentation defines late static binding as a way to "reference the called class in a context of static inheritance." This definition didn't really help me the first time I read it. Fortunately, there are more explanations in the documentation, and there are good examples. If you haven't, you should read it.

To clarify, he includes a code snippet showing the use of the "static" keyword to correctly reference a static method. He also includes in interesting bit about when's a good time to use it.

0 comments voice your opinion now!
late static binding lsb tutorial explaination


blog comments powered by Disqus

Similar Posts

Michelangelo van Dam's Blog: Quality Assurance on PHP projects - PHPUnit part 2

Klaus Graefensteiner's Blog: Two ways to test for prime numbers in PHP: Sieve and File

Pádraic Brady's Blog: The Factory and Abstract Factory patterns in PHP

Content with Style: Zend Framework with nginx and php-fastcgi

Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 5)


Community Events











Don't see your event here?
Let us know!


component facebook overview install opinion podcast unittest code example symfony2 framework language composer security introduction hhvm release hack application package

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework