fork(2) download
  1. <?php
  2.  
  3. class foo
  4. {
  5. function bar()
  6. {
  7. static $a = 0;
  8.  
  9. return $a++;
  10. }
  11. }
  12.  
  13. $a = new foo();
  14. var_dump($a->bar());
  15. var_dump($a->bar());
  16. var_dump($a->bar());
  17.  
  18. $b = new foo();
  19. var_dump($b->bar());
Success #stdin #stdout 0.02s 13112KB
stdin
Standard input is empty
stdout
int(0)
int(1)
int(2)
int(3)