Using Unified Constructors and Destructors
<?php class SimpleClass { function __construct($param) { echo "Created a new instance of SimpleClass!"; } function __destruct() { echo "Destroyed this instance of SimpleClass"; } } $myinstance = new SimpleClass("value"); unset($myinstance); ?>