|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-08-15 03:42 UTC] ky dot patterson at adlinkr dot com
[2015-04-07 17:07 UTC] nikic@php.net
-Status: Open
+Status: Duplicate
[2015-04-07 17:07 UTC] nikic@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 05:00:01 2025 UTC |
Description: ------------ While working on an Entity-Manager Class I noticed PHP has no function to determine the number of active references to a variable/object (like debug_zval_dump() does). It would be great if PHP provided that feature in later versions. Test script: --------------- /** * function to do the job: * */ function refcount ($var) { ob_start(); debug_zval_dump($var); $zval = ob_get_clean(); preg_match ("/refcount\\(([0-9]+)\\)/", $zval, $matches); return $matches[1]; }