1, $ndx); $msg = "PCFWarn: {$dbginfo['function']} was called from {$file} line {$dbginfo['line']}!"; $StopWatch[] = "{$msg}{$sfx}"; } else { ++$PCFWarnCtrs[$msgkey][0]; } } else { $StopWatch['PCF_unknown'] = "PCF was Called!"; } } } function PCFWarnAddCounts () { global $StopWatch, $PCFWarnCtrs; foreach ($PCFWarnCtrs as $val) { list($cnt, $ndx) = $val; $times = $cnt . ($cnt > 1 ? ' times' : ' time'); $StopWatch[$ndx] = preg_replace('/(\\d)!/', "\$1 $times!", $StopWatch[$ndx]); } } function PCFStopWatchHTML($pagename, $print = 0) { global $StopWatch; StopWatch('now'); $l = strlen(count($StopWatch)); $out = '
';
  foreach((array)$StopWatch as $i => $x)
    $out .= sprintf("%{$l}d: %s\n", $i, $x);
  $out .= '
'; if (is_array($StopWatch)) array_pop($StopWatch); if ($print) print $out; return $out; }