- Output for 5.4.0 - 5.4.27
- Fatal error: Call-time pass-by-reference has been removed in /in/3HVkg on line 5
Process exited with code 255. - Output for 5.3.0 - 5.3.29
- Deprecated: Call-time pass-by-reference has been deprecated in /in/3HVkg on line 5 22
<?php
function countRefs($var) {
ob_start();
debug_zval_dump(&$var);
preg_match('~refcount\((\d+)\)~', ob_get_clean(), $matches);
return $matches[1]; // - 4;
}
$a = 0;
$a = &$a;
echo countRefs($a);
$a = &$a;
echo countRefs($a);