How to make a instance delete it's self

ok say i wanted to add a function to a class that made it delete its self, this code checks out to be ok, but doesn’t work can somebody explain to me how i would do this


class suicide {
    function suicide() {
        delete this;
    }
}