fork download
  1. // Difference between "unset($a);" and "$a = NULL;" :
  2. <?php
  3. // unset($a)
  4. $a = 5;
  5. $b = & $a;
  6. unset($a);
  7. print "b $b \n"; // b 5
  8.  
  9. // $a = NULL; (better I think)
  10. $a = 5;
  11. $b = & $a;
  12. $a = NULL;
  13. print "b $b \n"; // b
  14. print(! isset($b)); // 1
  15. ?>
Success #stdin #stdout 0s 82880KB
stdin
Standard input is empty
stdout
// Difference between "unset($a);" and "$a = NULL;" :
b 5 
b  
1