I've made a class that acts like an file wrapper. When user call delete method, i want to unset the object (actually $this). Is there a way (workaround) to do that? The manual said no, there is no way...
As far as I know, there is no way to destroy a class instance from within the class itself. You'll have to unset the instance within its scope.
$myClass = new fooBar();
unset($myClass);
Somewhat related: Doing the above will automatically call any existing __destruct()
magic method of the class so you can do any additional cleanup. More info