Re: Re: objects passed as reference in php5

From: Date: Mon, 09 Aug 2004 18:28:12 +0000
Subject: Re: Re: objects passed as reference in php5
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-12041@lists.php.net to get a copy of this message
Hello Curt, Monday, August 9, 2004, 7:46:07 PM, you wrote: > * Thus wrote Ron Korving: >> i think the object will only cease to exist when all references to it are >> gone > 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

« previous php.internals (#12041) next »