3

Possible Duplicate:
static::staticFunctionName()

What does the keyword static mean when it is placed just before a function call? In the place of a class name.

Like this:

static::createKernel();
Community
  • 1
  • 1
ziiweb
  • 29,901
  • 71
  • 176
  • 297
  • 3
    It does [late static binding](http://php.net/manual/en/language.oop5.late-static-bindings.php). The documentation page has examples which are short and to the point. – Jon Sep 20 '11 at 16:42

2 Answers2

6

It's a way of calling a Late Static Binding. I can't do a better job describing it than the PHP manual itself.

zzzzBov
  • 167,057
  • 51
  • 314
  • 358
1

It has almost the same meaning as self but instead in references the actual class, instead of the class from which the code is found. Example from php.net:

<?php 

class A { 
    const C = 'constA'; 
    public function m() { 
        echo static::C; 
    } 
} 

class B extends A { 
    const C = 'constB'; 
} 

$b = new B(); 
$b->m(); 

// output: constB 
?>
GolezTrol
  • 111,943
  • 16
  • 178
  • 202