Re: Re: objects passed as reference in php5
| From: | Andi Gutmans | Date: | Tue, 10 Aug 2004 07:24:21 +0000 |
| Subject: | Re: Re: objects passed as reference in php5 | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-12051@lists.php.net to get a copy of this message | ||
Yep. It was decided not to go down that route. You should have a good enough handle of your application to know where you are referencing global objects from (local ones are destroyed once a function is terminated).
If you don't, well, maybe try and improve the code which deals with global objects so that you have a better grasp of where they are. There are various ways of achieving that.
Andi
At 08:28 PM 8/9/2004 +0200, Marcus Boerger wrote:
Hello Curt, Monday, August 9, 2004, 7:46:07 PM, you wrote: * Thus wrote Ron Korving:Well there does seem to be another layer of referencing, since the a simple assignment without &$ will simply reference the object but in a different way. The problem I'm running into there doesn't seem to be a way to reliably detstroy an object without the programmer keeping track of the variable assignments and removing those references as well. I'm not sure if its possible or even php's responsibility but perhaps provide a tool that allow's a programmer to explicity destroy an object? with something like: Destroy($obj); This is not possible at all. Reference counting + garbage collection means we do know the exact number of references to an object. Destroying the referenced object before its reference count goes to zero means that we leave a reference pointing to nirvana. That would result in a SEGV. regards marcus -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.phpi think the object will only cease to exist when all references to it are gone