Re: zend_list_delete() doesn't.
| From: | Stanislav Malyshev | Date: | Thu, 08 Sep 2005 08:59:38 +0000 |
| Subject: | Re: zend_list_delete() doesn't. | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-18706@lists.php.net to get a copy of this message | ||
SG>><?php
SG>> $fp1 = fopen('test', 'w');
SG>> $fp2 = $fp1; /* Still a single zval* and le->refcount == 1 */
SG>> $fp3 = &$fp1; /* Two zval*s now and le->refcount == 2 */
SG>>
SG>> fclose($fp1);
I think this was discussed before, though I may be mistaken. The problem
here is that you expect fclose to kill the resource, however $fp2 still
refers it. Looks like there should be two operations for resource - one is
usual delref called when variable is destroyed and second is "hard kill"
called when something like fclose is used and invalidating all referring
variables. I remember there were some issues with that, but I can't
rememebr what they were...
--
Stanislav Malyshev, Zend Products Engineer
stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115