get_called_class() always returns the class you actually call. You call A2:: so it's A2.
On my site there's a tutorial with an LSB singleton abstract class. I'm not linking here because there's always a zombie vigilante that comes and removes the links without even looking. But it's in my description.
The catch with LSB is that a method in A can call a method in B which can call a method in A back. See this example:
header('Content-Type: text/plain'); // Pretty text output
// LSB Parent
class A {
// NOLSB: Will call Current Class method
static public function TriggerSelf() {
self::OverrideMe();
}
// LSB: Will call Inheriting Class method (or Current if none Inherits)
static public function TriggerStatic() {
static::OverrideMe();
}
// Method to Override
static public function OverrideMe() {
echo 'A here', PHP_EOL;
}
}
// LSB Child
class B extends A {
// Override by LSB
static public function OverrideMe() {
echo 'B here', PHP_EOL;
}
}
A::TriggerSelf(); // <- NO LSB
A::TriggerStatic(); // <- LSB (but not inheritance)
B::TriggerSelf(); // <- NO LSB
B::TriggerStatic(); // <- LSB (with inheritance, so it works)
See how B::TriggerStatic() allows A to call a B method while B::TriggerSelf() calls a A method. That's LSB. Parent class static methods can call child class static methods. It's pretty much static abstracts :)
Study the example, it'll make sense.