1

Sorry if the title looks odd, I don't know how to call it. I was inspecting a framework and I wonder how this works?

<?php
//namespace and use

abstract class Model {
    //...
    public function __call($method,$params){
        //some stuff
        return static::$$method;
    }
}

It's an abstract class, so to what class will static refer to? (considering it's not extending anything) I tried to var_dump method but that method is not in that class. And why does it have a double dollar sign.

EDIT: Oh it will call the __callStatic method. I need pills.

Jürgen Paul
  • 14,299
  • 26
  • 93
  • 133

1 Answers1

3

It's called "late static binding" and unlike self, which always refers to the context ("class"), where it is defined, it refers always to the context it is called on.

KingCrunch
  • 128,817
  • 21
  • 151
  • 173