fork download
  1. <?php
  2.  
  3. class Foo {
  4. function __construct() {
  5. print("Object created\n");
  6. }
  7.  
  8. function __destruct() {
  9. print("Object destroyed\n");
  10. }
  11. }
  12.  
  13.  
  14. $foo = new Foo();
  15.  
  16. print("Before unset()\n");
  17. unset($foo);
  18. print("After unset()\n");
Success #stdin #stdout 0s 82560KB
stdin
Standard input is empty
stdout
Object created
Before unset()
Object destroyed
After unset()