src/ConvertibleTimestamp.php
public static function setFakeTime( $fakeTime ) {
		if ( is_string( $fakeTime ) ) {
			$fakeTime = (int)static::convert( TS_UNIX, $fakeTime );
		}

		if ( is_int( $fakeTime ) ) {
			$fakeTime = function () use ( $fakeTime ) {
				return $fakeTime;
			};
		}

		$old = static::$fakeTimeCallback;
		static::$fakeTimeCallback = $fakeTime ? $fakeTime : null;
		return $old;
	}
public static function setFakeTime( $fakeTime ) {
		if ( is_string( $fakeTime ) ) {
			$fakeTime = (int)static::convert( TS_UNIX, $fakeTime );
		}

		if ( is_int( $fakeTime ) ) {
			$fakeTime = function () use ( $fakeTime ) {
				return $fakeTime;
			};
		}

		$old = static::$fakeTimeCallback;
		static::$fakeTimeCallback = $fakeTime ? $fakeTime : null;
		return $old;
	}
public static function setFakeTime ( $ fakeTime ) { if ( is_string ( $ fakeTime ) ) { $ fakeTime = ( int ) static :: convert ( TS_UNIX , $ fakeTime ) ; } if ( is_int ( $ fakeTime ) ) { $ fakeTime = function ( ) use ( $ fakeTime ) { return $ fakeTime ; } ; } $ old = static :: $ fakeTimeCallback ; static :: $ fakeTimeCallback = $ fakeTime ? $ fakeTime : null ; return $ old ; }
Set a fake time value or clock callback.

@param callable|string|int|false $fakeTime a fixed time string, or an integer Unix time, or
a callback() returning an int representing a UNIX epoch, or false to disable fake time and
go back to real time.

@return callable|null the previous fake time callback, if any.
Set a fake time value or clock callback .