Created
December 25, 2016 11:57
-
-
Save gorkamu/c2ac43faec6e340f49f8492e865f7167 to your computer and use it in GitHub Desktop.
Ejemplo de destructor mediante método mágico
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 "En el constructor\n"; | |
$this->name = "MyDestructableClass"; | |
} | |
function __destruct() { | |
print "Destruyendo " . $this->name . "\n"; | |
} | |
} | |
$obj = new MyDestructableClass(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment