fork download
  1. <?php
  2.  
  3. class Cd
  4. {
  5. public $name;
  6.  
  7. public function __construct($a)
  8. {
  9. $this->name = $a;
  10. }
  11. }
  12.  
  13. $a=new Cd(1);
  14.  
  15. $b=$a;
  16.  
  17. echo "$a->name\n";
  18. unset($a);
  19.  
  20. if(isset($a))
  21. echo "live a\n";
  22. else
  23. echo "die a\n";
  24.  
  25.  
  26. if(isset($b))
  27. echo "live b\n";
  28. else
  29. echo "die b\n";
  30.  
  31. echo "$b->name\n";
  32.  
Success #stdin #stdout #stderr 0.02s 24448KB
stdin
Standard input is empty
stdout
1
die a
live b
1
NULL
object(Cd)#1 (1) {
  ["name"]=>
  int(1)
}
stderr
PHP Notice:  Undefined variable: a in /home/WX1Kk9/prog.php on line 33