add bitset operations and tests
[hiphop-php.git] / hphp / test / slow / late_static_binding / 1877.php
blob50ed9cae9de316a699eb514149483008c04e149d
1 <?php
3 class A {
4 static public function foo() {
5 static::bar();
7 public function bar() {
8 var_dump(__CLASS__);
10 public function foo2() {
11 B::foo();
12 // B always changes 'static'
13 self::foo();
14 // 'self' doesn't change 'static'
17 class B extends A {
18 public function bar() {
19 var_dump(__CLASS__);
21 public function foo3() {
22 $this->foo();
23 // $this changes 'static'
24 parent::foo();
25 // 'parent' doesn't change 'static'
29 $a = new A();
30 $b = new B();
32 B::foo();
33 // B
34 $b->foo();
35 // B
37 $b->foo2();
38 // BB
39 $b->foo3();
40 // BB
42 A::foo();
43 // A
44 $a->foo();
45 // A
47 $a->foo2();
48 // BA