Re: [PHP] unable to unset reference

2008-02-21 Thread Richard Lynch
On Wed, February 20, 2008 9:23 am, Sylvain R. wrote: > I would like to implement it in order to delete automaticly from > memory > useless objects. > It can be really useful for example to make schedulers in PHP in order > to > avoid "max memory usage exceeded" errors. If you really don't need it

Re: [PHP] unable to unset reference

2008-02-20 Thread Chris
I don't mean unset($this) is the best wy to allow an object to destroy itself. I just say we miss something to auto destroy objects. We could also think about a magic method like __destroy(). An object that destroys itself is a really bad idea from an architectural point of view. I, as a consu

Re: [PHP] unable to unset reference

2008-02-20 Thread Sylvain R.
"Stut" <[EMAIL PROTECTED]> a écrit dans le message de news: [EMAIL PROTECTED] > Sylvain R. wrote: >> "Chris" <[EMAIL PROTECTED]> a écrit dans le message de news: >> [EMAIL PROTECTED] >>> Sylvain Rabot wrote: Hello, First of all I would like to know if one day we will be able to un

Re: [PHP] unable to unset reference

2008-02-20 Thread Stut
Sylvain R. wrote: "Chris" <[EMAIL PROTECTED]> a écrit dans le message de news: [EMAIL PROTECTED] Sylvain Rabot wrote: Hello, First of all I would like to know if one day we will be able to unset $this into a class in order to destroy the object. It could really be useful to prevent big memory

Re: [PHP] unable to unset reference

2008-02-20 Thread Sylvain R.
"Chris" <[EMAIL PROTECTED]> a écrit dans le message de news: [EMAIL PROTECTED] > Sylvain Rabot wrote: >> Hello, >> >> First of all I would like to know if one day we will be able to unset >> $this into a class in order to destroy the object. It could really be >> useful to prevent big memory usag

Re: [PHP] unable to unset reference

2008-02-19 Thread Chris
Hence my previous gibberish, I would expect a reference to be destroyed when the object is, but obviously it's not. It has nothing specifically to do with objects, it's all about how references are handled. $ php -a Interactive mode enabled http://blog.libssh2.org/index.php?/archives/51-Yo

Re: [PHP] unable to unset reference

2008-02-19 Thread Shawn McKenzie
Chris wrote: > Sylvain Rabot wrote: >> Hello, >> >> First of all I would like to know if one day we will be able to unset >> $this into a class in order to destroy the object. It could really be >> useful to prevent big memory usage. > > I doubt the php-dev's will ever allow something like that, s

Re: [PHP] unable to unset reference

2008-02-19 Thread Chris
Sylvain Rabot wrote: Hello, First of all I would like to know if one day we will be able to unset $this into a class in order to destroy the object. It could really be useful to prevent big memory usage. I doubt the php-dev's will ever allow something like that, seems rather dangerous to me.

[PHP] unable to unset reference

2008-02-19 Thread Sylvain Rabot
Hello, First of all I would like to know if one day we will be able to unset $this into a class in order to destroy the object. It could really be useful to prevent big memory usage. As it can't be done I tried to unset an object by unsetting a reference of this object but it has no effect on the