that is correct and that is the problem, and even that is not all !!!
try this
<?php
abstract class a {
public function __construct(){
echo "constructing....<br>";
}
public function __detruct(){
echo "destructing....<br>";
}
}
class b extends a{
}
$c = new b();
unset( $c );
?>
the constructor is inherited, the destructor not !!
PHP 5.2.9-1 and
PHP 5.3.0 behave the same
las trampas de la vida
[email protected]
"Stuart" <[email protected]> wrote in message
news:[email protected]...
> 2009/8/24 kranthi <[email protected]>:
> > unset($obj) always calls the __destruct() function of the class.
> >
> > in your case clearly you are missing something else. Probably
> > unset($anobject) is not being called at all ?
>
> That's not entirely correct. PHP uses reference counting, so if
> unsetting a variable did not cause the object to be destructed then
> it's highly likely that there is another variable somewhere that is
> holding a reference to that object.
>
> -Stuart
>
> --
> http://stut.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php