|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-01-03 13:27 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 13:00:01 2025 UTC |
Description: ------------ Currently, I filter out the content of the function debug_zval_dump() to get the reference count of a variable. It would be better if there was a function in PHP to get this information straight away, without the need for parsing output. Reproduce code: --------------- // My current code: ob_start(); debug_zval_dump($var); $output = ob_get_contents(); ob_end_clean(); $pos = strpos($output, "refcount("); if ($pos === false) return 0; $refcount = intval(substr($output, $pos + 9)); // Feature request: $refcount = refcount($var); Expected result: ---------------- The internal refcount of a variable Actual result: -------------- N/A