<?php
abstract class A {
protected static $self;
private function __construct() {
echo "parent constructor" ;
static::$self = $this;
}
public static final function AI() {
return static::$self;
}
}
class B extends A {
function c() {
echo get_class(self::$self);
}
}
$b = B::AI();
$b->c();
Fatal error: Uncaught Error: Call to a member function c() on null in /in/pW3vA:26
Stack trace:
#0 {main}
thrown in /in/pW3vA on line 26
Process exited with code 255.
Output for 5.6.0 - 5.6.40
Fatal error: Call to a member function c() on null in /in/pW3vA on line 26
Process exited with code 255.