Created
October 6, 2012 21:32
-
-
Save mpmont/3846198 to your computer and use it in GitHub Desktop.
construct destruct
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MyDestructableClass { | |
function __construct() { | |
print "In constructor\n"; | |
$this->name = "MyDestructableClass"; | |
} | |
function __destruct() { | |
print "Destroying " . $this->name . "\n"; | |
} | |
} | |
$obj = new MyDestructableClass(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment