fork(2) download
  1. <?
  2. class test{
  3. var $a;
  4. function __construct($a){
  5. return $this->a = $a;
  6. }
  7. function A(){
  8. return $this->a;
  9. }
  10. function runCons($a){
  11. return self::__construct($a);
  12. }
  13. }
  14.  
  15. $t = new test(123);
  16. echo $t->A()."\n";
  17.  
  18. $t2 = $t->runCons(456);
  19. echo $t2."\n";
  20. echo $t2->A()."\n";
Runtime error #stdin #stdout 0.02s 13112KB
stdin
Standard input is empty
stdout
123
456

Fatal error: Call to a member function A() on a non-object in /home/DYUoYP/prog.php on line 20