$releases) { $supportedVersions[$major] = array_keys($releases); } if (isset($_GET["version"])) { $versionArray = version_array($_GET["version"]); $ver = $versionArray[0]; if (isset($RELEASES[$ver])) { $combinedReleases = array_replace_recursive($RELEASES, $OLDRELEASES); $max = (int) ($_GET['max'] ?? 1); if ($max == -1) { $max = PHP_INT_MAX; } $count = 0; foreach ($combinedReleases[$ver] as $version => $release) { if ($max <= $count) { break; } if (compare_version($versionArray, $version) == 0) { if (!isset($_GET['max'])) { $release['supported_versions'] = $supportedVersions[$ver] ?? []; } $machineReadable[$version] = $release; $count++; } } if (!isset($_GET['max']) && !empty($machineReadable)) { $version = key($machineReadable); $machineReadable = current($machineReadable); $machineReadable["version"] = $version; } } if (empty($machineReadable)) { $machineReadable = ["error" => "Unknown version"]; } } else { foreach ($RELEASES as $major => $release) { $version = key($release); $r = current($release); $r["version"] = $version; $r['supported_versions'] = $supportedVersions[$major] ?? []; $machineReadable[$major] = $r; } } if (isset($_GET["serialize"])) { header('Content-type: text/plain'); echo serialize($machineReadable); } elseif (isset($_GET["json"])) { header('Content-Type: application/json'); echo json_encode($machineReadable); } return; } // Human Readable. site_header("Releases", [ 'current' => 'downloads', 'css' => '/styles/releases.css', ]); echo "
We have collected all the official information and code available for past PHP releases. You can find more details on the current release on our downloads page. Please note that older releases are listed for archival purposes only, and they are no longer supported.
\n"; $active_majors = array_keys($RELEASES); $latest = max($active_majors); foreach ($OLDRELEASES as $major => $a) { echo ''; if (!in_array($major, $active_majors, false)) { echo "\nSupport for PHP $major has been discontinued "; echo "since " . current($a)['date'] . '.'; echo "Please consider upgrading to $latest.
\n"; } $i = 0; foreach ($a as $ver => $release) { $i++; mk_rel( $major, $ver, $release["date"], $release["announcement"] ?? false, $release["source"] ?? [], $release["windows"] ?? [], $release["museum"] ?? ($i >= 3), ); } } site_footer(['sidebar' => 'The most recent branches to reach end of life status are: