- ob_get_clean: documentation ( source)
- var_dump: documentation ( source)
- ob_start: documentation ( source)
- preg_match: documentation ( source)
<?php
$a= & $_POST;
$a=array();
function isRef($var) {
$info = getZvalRefCountInfo($var);
return (boolean) $info['is_ref'];
}
function getZvalRefCountInfo($var) {
ob_start();
xdebug_debug_zval($var);
$info = ob_get_clean();
preg_match('(: \(refcount=(\d+), is_ref=(\d+)\))', $info, $match);
return array('refcount' => $match[1], 'is_ref' => $match[2]);
}
var_dump(isRef($a));