All pastes #426598 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-04-06 07:27 UTC
rendered paste body
<?php

function foo($refresh = FALSE) {
  static $storage;
  if ($refresh) {
    unset($storage);
  }

  if (!isset($storage)) {
    $storage['x'] = microtime();
  }
  return $storage['x'];
}
echo foo() ."\n";
echo foo(TRUE) ."\n";
echo foo() ."\n";