diff --git a/public/releases/branch.php b/public/releases/branch.php
new file mode 100644
index 0000000000..b3592e2d48
--- /dev/null
+++ b/public/releases/branch.php
@@ -0,0 +1,85 @@
+
+
PHP Release Branch Not Found
+ See the supported versions for available branches.
+ 'Active support',
+ 'security' => 'Security fixes only',
+ 'eol' => 'End of life',
+ 'future' => 'Upcoming',
+ default => 'Unknown',
+};
+$latest = $release['version'];
+$dates = ['Initial release' => get_branch_release_date($branch)];
+if (version_compare($branch, '5.3', '>=')) {
+ $dates['Active support ends'] = get_branch_bug_eol_date($branch);
+ $dates['Security support ends'] = get_branch_security_eol_date($branch);
+} else {
+ // The historical data records the final release as the end of life.
+ $dates['End of life'] = get_branch_security_eol_date($branch);
+ if ($state === null && $dates['End of life'] !== null) {
+ $status = 'End of life';
+ }
+}
+
+site_header("PHP $branch Release");
+?>
+
+PHP = htmlspecialchars($branch) ?> Release
+
+
+ - Support status
+ - = htmlspecialchars($status) ?>
+ - Latest release
+ - = htmlspecialchars($latest) ?>
+ $date): ?>
+ - = htmlspecialchars($label) ?>
+ -
+
+
+
+ Unknown
+
+
+
+
+
+
+
+
diff --git a/public/supported-versions.php b/public/supported-versions.php
index 56075cb97d..d2ba949c73 100644
--- a/public/supported-versions.php
+++ b/public/supported-versions.php
@@ -73,7 +73,7 @@
?>
|
-
+
|
format('j M Y')) ?> |
|
diff --git a/tests/EndToEnd/ReleaseBranchTest.php b/tests/EndToEnd/ReleaseBranchTest.php
new file mode 100644
index 0000000000..ab855fe8e3
--- /dev/null
+++ b/tests/EndToEnd/ReleaseBranchTest.php
@@ -0,0 +1,64 @@
+getPage('/supported-versions.php', 200);
+ $rows = $listing->query('//table[thead/tr/th = "Branch"]/tbody/tr');
+ self::assertInstanceOf(DOMNodeList::class, $rows);
+ self::assertGreaterThan(0, $rows->length);
+
+ foreach ($rows as $row) {
+ self::assertInstanceOf(DOMElement::class, $row);
+ $branch = trim((string) $listing->evaluate('string(td[1]/a)', $row));
+ $href = $listing->evaluate('string(td[1]/a/@href)', $row);
+ self::assertIsString($href);
+ self::assertSame('/releases/branch.php?version=' . $branch, $href);
+
+ $details = $this->getPage($href, 200);
+ self::assertSame('PHP ' . $branch . ' Release', $details->evaluate('string(//h1)'));
+ $supportDates = $details->query('//dl/dd/time');
+ self::assertInstanceOf(DOMNodeList::class, $supportDates);
+ self::assertCount(3, $supportDates);
+ foreach ([2, 4, 6] as $index => $column) {
+ $date = $supportDates->item($index);
+ self::assertInstanceOf(DOMElement::class, $date);
+ self::assertSame(
+ trim((string) $listing->evaluate("string(td[$column])", $row)),
+ $date->textContent,
+ );
+ }
+ }
+ }
+
+ public function testUnknownBranchReturnsNotFound(): void
+ {
+ $this->getPage('/releases/branch.php?version=999.999', 404);
+ }
+
+ private function getPage(string $path, int $status): DOMXPath
+ {
+ $handle = curl_init('http://' . getenv('HTTP_HOST') . $path);
+ curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
+ $body = curl_exec($handle);
+ self::assertSame($status, curl_getinfo($handle, CURLINFO_HTTP_CODE), $path);
+ self::assertIsString($body);
+
+ $document = new DOMDocument();
+ self::assertTrue($document->loadHTML($body, LIBXML_NOERROR | LIBXML_NOWARNING));
+
+ return new DOMXPath($document);
+ }
+}