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
tirenweb
  • 30,963
  • 73
  • 183
  • 303
  • 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
  • 174,988
  • 54
  • 320
  • 367
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
  • 114,394
  • 18
  • 182
  • 210