From 758771ffd6eea8fab19bb16a196f2df6bc02c0ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=A6=E7=94=B0=20=E6=86=B2=E5=A4=AA=E9=83=8E?= Date: Mon, 27 Jul 2026 11:07:13 +0900 Subject: [PATCH 1/4] Fix Uri\WhatWg\Url screens that ignore URL normalization A WHATWG URL does not store the port when it is the scheme's default, so getPort() and withPort() both echoed null while their screens claimed 443, and Url::parse() normalizes an empty path to "/", which its screen did not show. The extension is new in PHP 8.5, so these were wrong from the start. Echoing null renders as an empty box, so the two port examples use var_dump() now and also show a port that is kept: the contrast is what makes the normalization legible. --- reference/uri/uri/whatwg/url/getport.xml | 10 +++++++--- reference/uri/uri/whatwg/url/parse.xml | 2 +- reference/uri/uri/whatwg/url/withport.xml | 9 +++++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/reference/uri/uri/whatwg/url/getport.xml b/reference/uri/uri/whatwg/url/getport.xml index 10587042db8e..c123438c6158 100644 --- a/reference/uri/uri/whatwg/url/getport.xml +++ b/reference/uri/uri/whatwg/url/getport.xml @@ -35,16 +35,20 @@ getPort()); -echo $url->getPort(); +// 443 is the default port for https, so it is not stored. +$url = new \Uri\WhatWg\Url("https://example.com:443"); +var_dump($url->getPort()); ?> ]]> &example.outputs; diff --git a/reference/uri/uri/whatwg/url/parse.xml b/reference/uri/uri/whatwg/url/parse.xml index 560af29fd6e0..a14cb5ebf7a8 100644 --- a/reference/uri/uri/whatwg/url/parse.xml +++ b/reference/uri/uri/whatwg/url/parse.xml @@ -79,7 +79,7 @@ if ($url !== null) { &example.outputs; diff --git a/reference/uri/uri/whatwg/url/withport.xml b/reference/uri/uri/whatwg/url/withport.xml index 400eabac1e06..ec298021a044 100644 --- a/reference/uri/uri/whatwg/url/withport.xml +++ b/reference/uri/uri/whatwg/url/withport.xml @@ -50,16 +50,21 @@ withPort(443); +var_dump($url->getPort()); -echo $url->getPort(); +$url = $url->withPort(8443); +var_dump($url->getPort()); ?> ]]> &example.outputs; From 4f4b1b1df1d2938d175305e973a0062040da0918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=A6=E7=94=B0=20=E6=86=B2=E5=A4=AA=E9=83=8E?= Date: Mon, 27 Jul 2026 11:07:13 +0900 Subject: [PATCH 2/4] Drop the docref from the DateTimeZone::__construct() screen The bracketed link belongs to the html_errors output format rather than to the message the example prints, and no combination of html_errors and docref_root reproduces it on PHP 8.5. The screen was captured in a browser, where that reference is rendered as a link. --- reference/datetime/datetimezone/construct.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/datetime/datetimezone/construct.xml b/reference/datetime/datetimezone/construct.xml index 51c36dd7187c..938002b60bdb 100644 --- a/reference/datetime/datetimezone/construct.xml +++ b/reference/datetime/datetimezone/construct.xml @@ -152,8 +152,8 @@ foreach ($timezones as $tz) { From 3852cf4db7b9dddf54872eed28e3428859ad90c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=A6=E7=94=B0=20=E6=86=B2=E5=A4=AA=E9=83=8E?= Date: Mon, 27 Jul 2026 11:07:14 +0900 Subject: [PATCH 3/4] Fix a screen that never matched the engine it documents PcgOneseq128XslRr64 seeded with 42659 emits a156c0086dd79d44 second and 1e9f3107d56653d0 third, so jump(2) cannot produce the documented value. With that output both engines would agree, which is the opposite of what the example is there to show. --- reference/random/random/engine/pcgoneseq128xslrr64/jump.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/random/random/engine/pcgoneseq128xslrr64/jump.xml b/reference/random/random/engine/pcgoneseq128xslrr64/jump.xml index 62af3acbccf5..c22631f80260 100644 --- a/reference/random/random/engine/pcgoneseq128xslrr64/jump.xml +++ b/reference/random/random/engine/pcgoneseq128xslrr64/jump.xml @@ -104,9 +104,9 @@ echo "B: ", bin2hex($b->engine->generate()), "\n"; &example.outputs; From ff40a1a7660ffabed1bf8808d367447ce344ee12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=A6=E7=94=B0=20=E6=86=B2=E5=A4=AA=E9=83=8E?= Date: Mon, 27 Jul 2026 11:07:14 +0900 Subject: [PATCH 4/4] Set the timezone in the date_sun_info() example The example formats timestamps with date(), so its output followed the timezone of whoever ran it and could not be pinned down: the recorded values match no timezone on any PHP version I could test. The coordinates are Jerusalem, so the times are reported in that zone, as the polar night example below already does for Prudhoe Bay. --- .../datetime/functions/date-sun-info.xml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/reference/datetime/functions/date-sun-info.xml b/reference/datetime/functions/date-sun-info.xml index 6b9a781ee1d7..cf2c478fda26 100644 --- a/reference/datetime/functions/date-sun-info.xml +++ b/reference/datetime/functions/date-sun-info.xml @@ -175,6 +175,7 @@ $val) { echo "$key: " . date("H:i:s", $val) . "\n"; @@ -184,15 +185,15 @@ foreach ($sun_info as $key => $val) { &example.outputs;