PHP code example of wmde / clock
1. Go to this page and download the library: Download wmde/clock library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
wmde / clock example snippets
function yourCode(Clock $clock) {
$time = $clock->now(); // Returns DateTimeImmutable. No global access and easily testable
}
interface Clock {
public function now(): \DateTimeImmutable;
}