Re: Get reference count on a variable.
| From: | Hannes Magnusson | Date: | Sat, 21 Aug 2004 11:33:32 +0000 |
| Subject: | Re: Get reference count on a variable. | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-194390@lists.php.net to get a copy of this message | ||
On Sat, 21 Aug 2004 04:10:53 +0000
php-general@zirzow.dyndns.org (Curt Zirzow) wrote:
> * Thus wrote Robert Cummings:
> > Hi All,
> >
> > I think I'm looking for something that doesn't exist, but just in
> > case thought I'd check the list. Does anyone know if a PHP function
> > exists to get the number of references on a given variable's data? I was
> > hoping to create a way for a factory to automatically recycle resources
> > without the need for the developer to call some kind of free() method.
> > If I could get the internal reference count then I'd be able to
> > determine if it is free by virtue of only 1 reference (the factory).
> > This is for PHP4 btw, the solution is trivial in PHP5 using destructors.
>
> unfortantly there isn't a method to determain this.
>
> Be careful with PHP5, i'm not sure if its applicable in your
> situation, but there does seem to be rumor that php5 objects are
> assigned by reference, which isn't true:
http://zend.com/expert_qa/qas.php?id=41&single=1
please read :)
- Hannes