Constructors and Destructors
<?php
    class OS {
        function __construct($name) {
            echo "Constructor called<br />";
        }

        function __destruct() {
            echo "Destructor called<br />";
        }
    }

    $linux = new OS('linux');
    echo "Step 1<br />";
    $ref   = $linux;
    echo "Step 2<br />";
    $linux = NULL;
    echo "Step 3<br />";
    $ref = NULL;
    echo "Step 4<br />";
?>
Output
Constructor called
Step 1
Step 2
Step 3
Destructor called
Step 4