Example 1 — Checking the Format of the Version
The version number changes with each PHP build, so we check its type and shape instead of printing it.
<?php
$version = timezone_version_get();
var_dump(is_string($version));
var_dump($version !== '');
var_dump(preg_match('/^\d{4}\.\d+$/', $version) === 1); How It Works
- timezone_version_get() returns a string.
- The string is never empty.
- The regular expression checks for a four-digit year, a dot, and a release number.

