From aad3d93125bd0a4c6626a475a1f80cb79a396783 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 12:04:43 +0900 Subject: [PATCH 01/20] Update screens for operator semantics that changed Since PHP 8.0 "+" and "-" bind tighter than ".", so the concatenation example no longer prints -1. Its comments were written for the old grouping and stayed behind; the example below it, kept non-interactive, carries that history. Since PHP 7.3 a constant is allowed on the left of instanceof and evaluates to false instead of raising a fatal error; the prose above that example already says so. --- language/operators/precedence.xml | 14 +++++++++----- language/operators/type.xml | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/language/operators/precedence.xml b/language/operators/precedence.xml index 35ac34c0cb7a..d54067490f40 100644 --- a/language/operators/precedence.xml +++ b/language/operators/precedence.xml @@ -377,10 +377,10 @@ $array[$i] = $i++; // may set either index 1 or 2 diff --git a/language/operators/type.xml b/language/operators/type.xml index 3c6dd538388b..6fbcbaa81d63 100644 --- a/language/operators/type.xml +++ b/language/operators/type.xml @@ -188,7 +188,7 @@ var_dump(FALSE instanceof stdClass); bool(false) bool(false) bool(false) -PHP Fatal error: instanceof expects an object instance, constant given +bool(false) ]]> From 99304e821fb3a4b3871bf5315cda8b10ed4997c4 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 12:04:43 +0900 Subject: [PATCH 02/20] Update screens for diagnostics that changed Reading a missing array key is a warning rather than a notice since PHP 8.0, so the sentence introducing that example moves with the screen. Since PHP 8.2 the ValueError from BackedEnum::from() no longer quotes the enum name. --- language/control-structures/foreach.xml | 6 +++--- language/predefined/backedenum/from.xml | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/language/control-structures/foreach.xml b/language/control-structures/foreach.xml index a424f4964612..c9936f6415c0 100644 --- a/language/control-structures/foreach.xml +++ b/language/control-structures/foreach.xml @@ -221,7 +221,7 @@ foreach ($array as [, , $c]) { - A notice will be generated if there aren't enough array elements to fill + A warning will be generated if there aren't enough array elements to fill the list: @@ -241,10 +241,10 @@ foreach ($array as [$a, $b, $c]) { &example.outputs; diff --git a/language/predefined/backedenum/from.xml b/language/predefined/backedenum/from.xml index 4ecd30257c18..386c5e913f37 100644 --- a/language/predefined/backedenum/from.xml +++ b/language/predefined/backedenum/from.xml @@ -71,7 +71,11 @@ $b = Suit::from('B'); From 410ad2f796be69eec4b1a77f3f65ada92de83a50 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 12:04:43 +0900 Subject: [PATCH 03/20] Reflect a tentative return type instead of a built-in function Both pages used array_merge() to show that reflection reports no return type for internal functions. Since PHP 8.0 it does report one, so the examples demonstrated nothing and the paragraph warning about built-ins was no longer true. A method with a tentative return type is the case that still reports none, so the examples use one and point at the accessors that return it. --- .../reflectionfunctionabstract/getreturntype.xml | 15 +++++++++------ .../reflectionfunctionabstract/hasreturntype.xml | 7 +++++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/reference/reflection/reflectionfunctionabstract/getreturntype.xml b/reference/reflection/reflectionfunctionabstract/getreturntype.xml index 157c45706b19..b32a4196fdef 100644 --- a/reference/reflection/reflectionfunctionabstract/getreturntype.xml +++ b/reference/reflection/reflectionfunctionabstract/getreturntype.xml @@ -56,28 +56,30 @@ int - Usage on built-in functions + Methods with a tentative return type getReturnType()); +echo $reflection2->getTentativeReturnType(); ]]> &example.outputs; - This is because many internal functions do not have types specified for their - parameters or return values. It is therefore best to avoid using this - method on built-in functions. + A tentative return type is not reported here; use + ReflectionFunctionAbstract::getTentativeReturnType + to obtain it. @@ -85,6 +87,7 @@ null &reftitle.seealso; + ReflectionFunctionAbstract::getTentativeReturnType ReflectionFunctionAbstract::hasReturnType ReflectionType::__toString diff --git a/reference/reflection/reflectionfunctionabstract/hasreturntype.xml b/reference/reflection/reflectionfunctionabstract/hasreturntype.xml index 40846a250b97..0c77adcbeceb 100644 --- a/reference/reflection/reflectionfunctionabstract/hasreturntype.xml +++ b/reference/reflection/reflectionfunctionabstract/hasreturntype.xml @@ -56,20 +56,22 @@ bool(true) - Usage on built-in functions + Methods with a tentative return type hasReturnType()); +var_dump($reflection2->hasTentativeReturnType()); ]]> &example.outputs; @@ -81,6 +83,7 @@ bool(false) ReflectionFunctionAbstract::getReturnType + ReflectionFunctionAbstract::hasTentativeReturnType From a5e54171cf46a03fe3ca2a87436a77986b70a5a0 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 12:04:43 +0900 Subject: [PATCH 04/20] Regenerate the ReflectionClass::__toString() screen The dump of Exception has drifted across several releases rather than one: property types and defaults are printed differently, tentative return types appeared, and the method count was stale. Regenerated from PHP 8.5 instead of reconstructed. --- .../reflection/reflectionclass/tostring.xml | 84 ++++++++++++++----- 1 file changed, 63 insertions(+), 21 deletions(-) diff --git a/reference/reflection/reflectionclass/tostring.xml b/reference/reflection/reflectionclass/tostring.xml index a72e41b62ab5..b5a2d987c9b8 100644 --- a/reference/reflection/reflectionclass/tostring.xml +++ b/reference/reflection/reflectionclass/tostring.xml @@ -46,7 +46,7 @@ echo $reflectionClass->__toString(); &example.outputs; class Exception ] { +Class [ class Exception implements Stringable, Throwable ] { - Constants [0] { } @@ -58,50 +58,92 @@ Class [ class Exception ] { } - Properties [7] { - Property [ protected $message ] - Property [ private $string ] - Property [ protected $code ] - Property [ protected $file ] - Property [ protected $line ] - Property [ private $trace ] - Property [ private $previous ] + Property [ protected $message = '' ] + Property [ private string $string = '' ] + Property [ protected $code = 0 ] + Property [ protected string $file = '' ] + Property [ protected int $line = 0 ] + Property [ private array $trace = [] ] + Property [ private ?Throwable $previous = NULL ] } - - Methods [10] { - Method [ final private method __clone ] { + - Methods [11] { + Method [ private method __clone ] { + + - Parameters [0] { + } + - Return [ void ] } Method [ public method __construct ] { - Parameters [3] { - Parameter #0 [ $message ] - Parameter #1 [ $code ] - Parameter #2 [ $previous ] + Parameter #0 [ string $message = "" ] + Parameter #1 [ int $code = 0 ] + Parameter #2 [ ?Throwable $previous = null ] } } - Method [ final public method getMessage ] { + Method [ public method __wakeup ] { + + - Parameters [0] { + } + - Tentative return [ void ] } - Method [ final public method getCode ] { + Method [ final public method getMessage ] { + + - Parameters [0] { + } + - Return [ string ] } - Method [ final public method getFile ] { + Method [ final public method getCode ] { + + - Parameters [0] { + } + } + + Method [ final public method getFile ] { + + - Parameters [0] { + } + - Return [ string ] } - Method [ final public method getLine ] { + Method [ final public method getLine ] { + + - Parameters [0] { + } + - Return [ int ] } - Method [ final public method getTrace ] { + Method [ final public method getTrace ] { + + - Parameters [0] { + } + - Return [ array ] } - Method [ final public method getPrevious ] { + Method [ final public method getPrevious ] { + + - Parameters [0] { + } + - Return [ ?Throwable ] } - Method [ final public method getTraceAsString ] { + Method [ final public method getTraceAsString ] { + + - Parameters [0] { + } + - Return [ string ] } - Method [ public method __toString ] { + Method [ public method __toString ] { + + - Parameters [0] { + } + - Return [ string ] } } } From 90da1c9f88da713fbdfcc8287739bb458f108a53 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 12:04:44 +0900 Subject: [PATCH 05/20] Update screens for how class names are printed Since PHP 8.0 an anonymous class is named after the class it extends. The note further down that page still showed the PHP 7 form, captured on 3v4l.org rather than from the example; the NUL byte the name contains is invisible in a screen, so the note now says so. Since PHP 8.2 var_export() writes class names fully qualified, with a leading backslash. --- language/oop5/anonymous.xml | 9 +++++---- language/oop5/magic.xml | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/language/oop5/anonymous.xml b/language/oop5/anonymous.xml index a551897f0f7b..bd38cf18745b 100644 --- a/language/oop5/anonymous.xml +++ b/language/oop5/anonymous.xml @@ -63,8 +63,8 @@ var_dump(new class(10) extends SomeClass implements SomeInterface { &example.outputs; +object(SomeClass@anonymous)#1 (1) { + ["num":"SomeClass@anonymous":private]=> int(10) } ]]> @@ -156,7 +156,8 @@ same class Note that anonymous classes are assigned a name by the engine, as demonstrated in the following example. This name has to be regarded as an - implementation detail, which should not be relied upon. + implementation detail, which should not be relied upon. The generated name + contains a NUL byte, which is not visible in the output below. @@ -168,7 +169,7 @@ echo get_class(new class {}); &example.outputs.similar; diff --git a/language/oop5/magic.xml b/language/oop5/magic.xml index c37257eed24c..5fc5682e8d23 100644 --- a/language/oop5/magic.xml +++ b/language/oop5/magic.xml @@ -527,7 +527,7 @@ var_dump($c); &example.outputs; 5, 'var2' => 'foo', ))" From 80193749f19efa9ac774b49e60f535491ca01f71 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 12:04:44 +0900 Subject: [PATCH 06/20] Update the mb_detect_encoding() screen for its PHP 8.3 behaviour Non-strict detection follows the documented rule since PHP 8.3, so this string now yields ASCII rather than UTF-8. The comment goes with it: it named UTF-8 as the closer match, and the two candidates are in fact equally distant here, so it should not name a winner at all. --- reference/mbstring/functions/mb-detect-encoding.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reference/mbstring/functions/mb-detect-encoding.xml b/reference/mbstring/functions/mb-detect-encoding.xml index 692ff51ef435..304fd48cfe94 100644 --- a/reference/mbstring/functions/mb-detect-encoding.xml +++ b/reference/mbstring/functions/mb-detect-encoding.xml @@ -178,7 +178,8 @@ string(5) "ASCII" // 'áéóú' encoded in ISO-8859-1 $str = "\xE1\xE9\xF3\xFA"; -// The string is not valid ASCII or UTF-8, but UTF-8 is considered a closer match +// The string is valid in neither encoding: non-strict reports the closest +// match, strict returns false var_dump(mb_detect_encoding($str, ['ASCII', 'UTF-8'], false)); var_dump(mb_detect_encoding($str, ['ASCII', 'UTF-8'], true)); @@ -191,7 +192,7 @@ var_dump(mb_detect_encoding($str, ['ASCII', 'UTF-8', 'ISO-8859-1'], true)); &example.outputs; Date: Sat, 1 Aug 2026 03:08:34 +0900 Subject: [PATCH 07/20] Split the mb_detect_encoding() screens at PHP 8.3 The non-strict change landed in 8.3.0, so 8.2 still prints the old result and one screen cannot cover both. The basic example is split too: its screen already showed only the 8.3 behaviour. --- .../mbstring/functions/mb-detect-encoding.xml | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/reference/mbstring/functions/mb-detect-encoding.xml b/reference/mbstring/functions/mb-detect-encoding.xml index 304fd48cfe94..a330ef899eb9 100644 --- a/reference/mbstring/functions/mb-detect-encoding.xml +++ b/reference/mbstring/functions/mb-detect-encoding.xml @@ -158,7 +158,16 @@ var_dump(mb_detect_encoding($str, $encodings)); ?> ]]> - &example.outputs; + &example.outputs.82; + + + + &example.outputs.83; ]]> - &example.outputs; + &example.outputs.82; + + + + &example.outputs.83; Date: Sat, 1 Aug 2026 03:19:06 +0900 Subject: [PATCH 08/20] Use simpara for the getReturnType() note docbook-cs de7e4fd tightened which elements SimparaSniff accepts, and the sentence this PR rewrites is inline-only. --- .../reflection/reflectionfunctionabstract/getreturntype.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/reflection/reflectionfunctionabstract/getreturntype.xml b/reference/reflection/reflectionfunctionabstract/getreturntype.xml index b32a4196fdef..51d44fb7082b 100644 --- a/reference/reflection/reflectionfunctionabstract/getreturntype.xml +++ b/reference/reflection/reflectionfunctionabstract/getreturntype.xml @@ -76,11 +76,11 @@ int - + A tentative return type is not reported here; use ReflectionFunctionAbstract::getTentativeReturnType to obtain it. - + From 05846fcff1920772229773e02edf5e4a93607044 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: Sat, 1 Aug 2026 16:52:16 +0900 Subject: [PATCH 09/20] Merge the . precedence examples and split them at PHP 8.0 --- language/operators/precedence.xml | 59 +++++++++++++++---------------- 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/language/operators/precedence.xml b/language/operators/precedence.xml index d54067490f40..4d4adcfdbf24 100644 --- a/language/operators/precedence.xml +++ b/language/operators/precedence.xml @@ -371,36 +371,6 @@ $array[$i] = $i++; // may set either index 1 or 2 ]]> - - <literal>+</literal>, <literal>-</literal> and <literal>.</literal> precedence - - -]]> - - &example.outputs; - - - - Prior to PHP 8, <literal>+</literal>, <literal>-</literal> and <literal>.</literal> had the same precedence @@ -418,16 +388,43 @@ echo "x minus one equals " . ($x-1) . ", or so I hope\n"; ?> ]]> - &example.outputs; + &example.outputs.71; + + &example.outputs.8; + + + + As of PHP 7.4.0 the first line also emits + Deprecated: The behavior of unparenthesized expressions containing + both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher + precedence. + + + As of PHP 8.0.0 the pitfall is gone, because - now binds + tighter than .. + The second line, which spells out the grouping that used to apply, throws a + TypeError instead, so the third line never + runs. + Although = has a lower precedence than From f2738aa8e92958e820281287bea38a21b1e5fa75 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: Sat, 1 Aug 2026 16:52:35 +0900 Subject: [PATCH 10/20] Note the instanceof constant error removed at PHP 7.3 --- language/operators/type.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/language/operators/type.xml b/language/operators/type.xml index 6fbcbaa81d63..c743ca30116c 100644 --- a/language/operators/type.xml +++ b/language/operators/type.xml @@ -178,6 +178,9 @@ $c = fopen('/tmp/', 'r'); var_dump($a instanceof stdClass); // $a is an integer var_dump($b instanceof stdClass); // $b is NULL var_dump($c instanceof stdClass); // $c is a resource + +// Prior to PHP 7.3.0 this was a compile-time error, so nothing above ran: +// instanceof expects an object instance, constant given var_dump(FALSE instanceof stdClass); ?> ]]> From 84e7d83443d694b346d5c8472577ab8b187e30d4 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: Sat, 1 Aug 2026 16:52:57 +0900 Subject: [PATCH 11/20] Split the foreach list() screens at PHP 8.0 --- language/control-structures/foreach.xml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/language/control-structures/foreach.xml b/language/control-structures/foreach.xml index c9936f6415c0..9ffa1ad72475 100644 --- a/language/control-structures/foreach.xml +++ b/language/control-structures/foreach.xml @@ -222,10 +222,11 @@ foreach ($array as [, , $c]) { A warning will be generated if there aren't enough array elements to fill - the list: + the list. + Prior to PHP 8.0.0 a notice was generated instead: - + - &example.outputs; + &example.outputs.71; + + + + &example.outputs.8; Date: Sat, 1 Aug 2026 16:53:16 +0900 Subject: [PATCH 12/20] Split the __set_state() screens at PHP 8.2 --- language/oop5/magic.xml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/language/oop5/magic.xml b/language/oop5/magic.xml index 5fc5682e8d23..48f0ef46606f 100644 --- a/language/oop5/magic.xml +++ b/language/oop5/magic.xml @@ -495,7 +495,7 @@ Array Using <link linkend="object.set-state">__set_state()</link> - + ]]> - &example.outputs; + &example.outputs.81; + + 5, + 'var2' => 'foo', +))" +object(A)#2 (2) { + ["var1"]=> + int(5) + ["var2"]=> + string(3) "foo" +} +]]> + + &example.outputs.82; Date: Sat, 1 Aug 2026 16:53:38 +0900 Subject: [PATCH 13/20] Keep Run code off the mb_detect_encoding() PHP 8.2 screen --- reference/mbstring/functions/mb-detect-encoding.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/mbstring/functions/mb-detect-encoding.xml b/reference/mbstring/functions/mb-detect-encoding.xml index a330ef899eb9..24972eee086a 100644 --- a/reference/mbstring/functions/mb-detect-encoding.xml +++ b/reference/mbstring/functions/mb-detect-encoding.xml @@ -133,7 +133,7 @@ <function>mb_detect_encoding</function> example - + Effect of <parameter>strict</parameter> parameter - + Date: Tue, 4 Aug 2026 19:54:31 +0900 Subject: [PATCH 14/20] Use `fopen()` to show a built-in without a declared return type --- .../reflectionfunctionabstract/getreturntype.xml | 12 ++++-------- .../reflectionfunctionabstract/hasreturntype.xml | 7 ++----- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/reference/reflection/reflectionfunctionabstract/getreturntype.xml b/reference/reflection/reflectionfunctionabstract/getreturntype.xml index 51d44fb7082b..94c0f5816093 100644 --- a/reference/reflection/reflectionfunctionabstract/getreturntype.xml +++ b/reference/reflection/reflectionfunctionabstract/getreturntype.xml @@ -56,30 +56,27 @@ int - Methods with a tentative return type + Usage on built-in functions getReturnType()); -echo $reflection2->getTentativeReturnType(); ]]> &example.outputs; - A tentative return type is not reported here; use - ReflectionFunctionAbstract::getTentativeReturnType - to obtain it. + Internal functions that return a resource have no declared return type, + because resource cannot be used in a type declaration. @@ -87,7 +84,6 @@ int &reftitle.seealso; - ReflectionFunctionAbstract::getTentativeReturnType ReflectionFunctionAbstract::hasReturnType ReflectionType::__toString diff --git a/reference/reflection/reflectionfunctionabstract/hasreturntype.xml b/reference/reflection/reflectionfunctionabstract/hasreturntype.xml index 0c77adcbeceb..229d10c3e220 100644 --- a/reference/reflection/reflectionfunctionabstract/hasreturntype.xml +++ b/reference/reflection/reflectionfunctionabstract/hasreturntype.xml @@ -56,22 +56,20 @@ bool(true) - Methods with a tentative return type + Usage on built-in functions hasReturnType()); -var_dump($reflection2->hasTentativeReturnType()); ]]> &example.outputs; @@ -83,7 +81,6 @@ bool(true) ReflectionFunctionAbstract::getReturnType - ReflectionFunctionAbstract::hasTentativeReturnType From ac230088786bee1a570f17e1de5cd54a8ed897ef 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: Tue, 4 Aug 2026 20:06:55 +0900 Subject: [PATCH 15/20] Document only the current `mb_detect_encoding()` output --- .../mbstring/functions/mb-detect-encoding.xml | 26 +++---------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/reference/mbstring/functions/mb-detect-encoding.xml b/reference/mbstring/functions/mb-detect-encoding.xml index 24972eee086a..304fd48cfe94 100644 --- a/reference/mbstring/functions/mb-detect-encoding.xml +++ b/reference/mbstring/functions/mb-detect-encoding.xml @@ -133,7 +133,7 @@ <function>mb_detect_encoding</function> example - + ]]> - &example.outputs.82; - - - - &example.outputs.83; + &example.outputs; Effect of <parameter>strict</parameter> parameter - + ]]> - &example.outputs.82; - - - - &example.outputs.83; + &example.outputs; Date: Tue, 4 Aug 2026 20:17:15 +0900 Subject: [PATCH 16/20] Document only the current `var_export()` output for `__set_state()` --- language/oop5/magic.xml | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/language/oop5/magic.xml b/language/oop5/magic.xml index 48f0ef46606f..5fc5682e8d23 100644 --- a/language/oop5/magic.xml +++ b/language/oop5/magic.xml @@ -495,7 +495,7 @@ Array Using <link linkend="object.set-state">__set_state()</link> - + ]]> - &example.outputs.81; - - 5, - 'var2' => 'foo', -))" -object(A)#2 (2) { - ["var1"]=> - int(5) - ["var2"]=> - string(3) "foo" -} -]]> - - &example.outputs.82; + &example.outputs; Date: Tue, 4 Aug 2026 20:46:44 +0900 Subject: [PATCH 17/20] Update the anonymous class screens that no version produces --- language/oop5/anonymous.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/language/oop5/anonymous.xml b/language/oop5/anonymous.xml index bd38cf18745b..710906fcce5e 100644 --- a/language/oop5/anonymous.xml +++ b/language/oop5/anonymous.xml @@ -156,8 +156,7 @@ same class Note that anonymous classes are assigned a name by the engine, as demonstrated in the following example. This name has to be regarded as an - implementation detail, which should not be relied upon. The generated name - contains a NUL byte, which is not visible in the output below. + implementation detail, which should not be relied upon. From 78a36c5270d00599e6adc13739baf0a7ac5c47e4 Mon Sep 17 00:00:00 2001 From: KentarouTakeda <4785040+KentarouTakeda@users.noreply.github.com> Date: Tue, 4 Aug 2026 20:51:16 +0900 Subject: [PATCH 18/20] Apply suggestions from code review Co-authored-by: Kamil Tekiela --- language/control-structures/foreach.xml | 5 ++--- language/operators/type.xml | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/language/control-structures/foreach.xml b/language/control-structures/foreach.xml index 9ffa1ad72475..4caeacbbc043 100644 --- a/language/control-structures/foreach.xml +++ b/language/control-structures/foreach.xml @@ -221,9 +221,8 @@ foreach ($array as [, , $c]) { - A warning will be generated if there aren't enough array elements to fill - the list. - Prior to PHP 8.0.0 a notice was generated instead: + If there are not enough array elements to populate the variables, + a warning is emitted; prior to PHP 8.0.0, a notice was emitted instead: diff --git a/language/operators/type.xml b/language/operators/type.xml index c743ca30116c..dd5ffce3fe59 100644 --- a/language/operators/type.xml +++ b/language/operators/type.xml @@ -179,7 +179,7 @@ var_dump($a instanceof stdClass); // $a is an integer var_dump($b instanceof stdClass); // $b is NULL var_dump($c instanceof stdClass); // $c is a resource -// Prior to PHP 7.3.0 this was a compile-time error, so nothing above ran: +// Prior to PHP 7.3.0, using a constant would trigger a compile-time fatal error with the following message: // instanceof expects an object instance, constant given var_dump(FALSE instanceof stdClass); ?> From db1b8814fa069ce3a6fbb479c2173ab5c4026f32 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: Tue, 4 Aug 2026 20:54:03 +0900 Subject: [PATCH 19/20] Mark the volatile Reflection and enum screens as similar output Co-authored-by: Claude Opus 5 --- language/predefined/backedenum/from.xml | 6 +----- reference/reflection/reflectionclass/tostring.xml | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/language/predefined/backedenum/from.xml b/language/predefined/backedenum/from.xml index 386c5e913f37..395725cab51b 100644 --- a/language/predefined/backedenum/from.xml +++ b/language/predefined/backedenum/from.xml @@ -66,16 +66,12 @@ $b = Suit::from('B'); ?> ]]> - &example.outputs; + &example.outputs.similar; diff --git a/reference/reflection/reflectionclass/tostring.xml b/reference/reflection/reflectionclass/tostring.xml index b5a2d987c9b8..8efbfe8b1143 100644 --- a/reference/reflection/reflectionclass/tostring.xml +++ b/reference/reflection/reflectionclass/tostring.xml @@ -43,7 +43,7 @@ echo $reflectionClass->__toString(); ?> ]]> - &example.outputs; + &example.outputs.similar; class Exception implements Stringable, Throwable ] { From f71c8bed303228c6da617a1cf807c49a1ba9e948 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: Tue, 4 Aug 2026 21:29:04 +0900 Subject: [PATCH 20/20] Leave the opaque anonymous class name alone Co-authored-by: Claude Opus 5 --- language/oop5/anonymous.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/language/oop5/anonymous.xml b/language/oop5/anonymous.xml index 710906fcce5e..e7462652727a 100644 --- a/language/oop5/anonymous.xml +++ b/language/oop5/anonymous.xml @@ -168,7 +168,7 @@ echo get_class(new class {}); &example.outputs.similar;