fork download
  1. <?php
  2.  
  3. class example {
  4. private $data = null;
  5.  
  6. public function f1(){
  7. $v = 888;
  8. //some code
  9. $this->data = $v;
  10. }
  11.  
  12. function f2(){
  13. echo $this -> data;
  14. }
  15. }
  16.  
  17. $obj = new example();
  18. $obj -> f1();
  19. $obj -> f2();
Success #stdin #stdout 0.02s 52472KB
stdin
Standard input is empty
stdout
888