Mantis - Quercus
Viewing Issue Advanced Details
3213 minor always 12-30-08 15:36 01-04-09 11:32
koreth  
ferg  
normal  
closed 4.0.0  
fixed  
none    
none 4.0.0  
0003213: Subclasses don't get separate copies of superclass method statics
<?php
class P {
  public function setStatic($x) {
    static $var = null;
    if (!$var) {
      $var = $x;
    }
    print $var;
  }
}

class C1 extends P {
  public function test1() {
    $this->setStatic('a');
  }
}

class C2 extends P {
  public function test2() {
    $this->setStatic('b');
  }
}

$o1 = new C1;
$o2 = new C2;
$o1->test1();
$o2->test2();


Regular PHP prints "ab". Quercus prints "aa".

Notes
(0003692)
ferg   
01-04-09 11:32   
php/3248