NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Find all references to an object


Joined: 27 Nov 2009
Posts: 98
Reply with quote
I am trying to delete an object, however, there is still some existing reference to it and thus PHP's garbage collector is not deleting it and the object's destructor is not being called. I've searched how to determine existing references to an object, and the only think I found was https://www.php.net/manual/en/features.gc.refcounting-basics.php which states that xdebug must be installed. Before doing so, please advise whether latest version of phpED has the ability to gather this information. This old post http://forum.nusphere.com/what-is-a-soft-reference-t1232.html references "soft links" which sounds somewhat related, but current versions of phpED do not appear to display. Thanks
View user's profileFind all posts by NotionCommotionSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
You can use debug_zval_dump() that's available in php core and therefore does not require any extensions. It prints variable and reference counter value.
https://www.php.net/manual/en/function.debug-zval-dump.php
Note that if you have a variable in current context, its ref cout can't be zero, otherwise it would have already been deleted.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Find all references to an object
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic