#40011 [Opn->WFx]: Request for refcount function

From: Date: Wed, 03 Jan 2007 13:27:52 +0000
Subject: #40011 [Opn->WFx]: Request for refcount function
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-107123@lists.php.net to get a copy of this message
ID: 40011 Updated by: derick@php.net Reported By: emiel dot bruijntjes at copernica dot nl -Status: Open +Status: Wont fix Bug Type: Feature/Change Request Operating System: Linux PHP Version: 5.2.0 New Comment: This function is inherently flawed as by passing the variable to the function the refcount (and other bits) might already be changed. Therefore you shouldn't count on this function too much anyway. Previous Comments: ------------------------------------------------------------------------ [2007-01-03 13:24:37] emiel dot bruijntjes at copernica dot nl 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40011&edit=1

« previous php.bugs (#107123) next »