Index: /trunk/Decompiler.class.php
===================================================================
--- /trunk/Decompiler.class.php	(revision 779)
+++ /trunk/Decompiler.class.php	(revision 780)
@@ -737,4 +737,6 @@
 		$EX['last'] = count($opcodes) - 1;
 		$EX['silence'] = 0;
+		$EX['recvs'] = array();
+		$EX['uses'] = array();
 
 		for ($next = 0, $last = $EX['last'];
@@ -1140,4 +1142,12 @@
 					}
 					$resvar = "$lvalue = " . str($rvalue, $EX);
+					if (0) {
+					if ($op2['op_type'] == XC_IS_VAR) {
+						$resvar .= ' /* isvar */';
+					}
+					else if ($op2['op_type'] == XC_IS_TMP_VAR) {
+						$resvar .= ' /* istmp */';
+					}
+					}
 					break;
 					// }}}
@@ -1842,4 +1852,17 @@
 	}
 	// }}}
+	function duses(&$EX, $indent) // {{{
+	{
+		if (!$EX['uses']) {
+			return;
+		}
+
+		$uses = array();
+		foreach ($EX['uses'] as $name => $value) {
+			$uses = '$' . $name;
+		}
+		echo ' use(', implode(', ', $uses), ')';
+	}
+	// }}}
 	function dfunction($func, $indent = '', $nobody = false) // {{{
 	{
@@ -1850,4 +1873,5 @@
 			$EX['op_array'] = &$func['op_array'];
 			$EX['recvs'] = array();
+			$EX['uses'] = array();
 		}
 		else {
@@ -1856,7 +1880,4 @@
 			$EX = &$this->dop_array($func['op_array'], $newindent);
 			$body = ob_get_clean();
-			if (!isset($EX['recvs'])) {
-				$EX['recvs'] = array();
-			}
 		}
 
@@ -1868,4 +1889,5 @@
 		$this->dargs($EX, $indent);
 		echo ")";
+		$this->duses($EX, $indent);
 		if ($nobody) {
 			echo ";\n";
Index: /trunk/decompilesample.php
===================================================================
--- /trunk/decompilesample.php	(revision 779)
+++ /trunk/decompilesample.php	(revision 780)
@@ -363,4 +363,5 @@
 	static $static = array(1);
 	$tax = 'tax';
+	$tax = --$tax;
 	$pricePerItem = constant('PRICE_' . strtoupper($product));
 	$total += $pricePerItem * $quantity * ($tax + 1);
Index: /trunk/xcache.c
===================================================================
--- /trunk/xcache.c	(revision 779)
+++ /trunk/xcache.c	(revision 780)
@@ -2875,4 +2875,28 @@
 }
 /* }}} */
+/* {{{ proto int xcache_get_refcount(mixed variable)
+   Get reference count of variable */
+PHP_FUNCTION(xcache_get_refcount)
+{
+	zval *variable;
+	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &variable) == FAILURE) {
+		RETURN_NULL();
+	}
+
+	RETURN_LONG(Z_REFCOUNT_P(variable));
+}
+/* }}} */
+/* {{{ proto bool xcache_get_isref(mixed variable)
+   check if variable data is marked referenced */
+PHP_FUNCTION(xcache_get_isref)
+{
+	zval *variable;
+	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &variable) == FAILURE) {
+		RETURN_NULL();
+	}
+
+	RETURN_BOOL(Z_ISREF_P(variable));
+}
+/* }}} */
 #ifdef HAVE_XCACHE_DPRINT
 /* {{{ proto bool  xcache_dprint(mixed value)
@@ -3116,4 +3140,6 @@
 	PHP_FE(xcache_unset,             NULL)
 	PHP_FE(xcache_unset_by_prefix,   NULL)
+	PHP_FE(xcache_get_refcount,      NULL)
+	PHP_FE(xcache_get_isref,         NULL)
 #ifdef HAVE_XCACHE_DPRINT
 	PHP_FE(xcache_dprint,            NULL)
