<?phpclass A { public static function counter() { static $i = 0; return ++$i; }}class B extends A {} echo A::counter(), ' ';echo A::counter(), ' ';echo B::counter(), ' ';echo B::counter();
1 2 1 2
1 2 3 4