From eeeabed0b9366dfa9ec4a6ed6bf1414a8f9d5349 Mon Sep 17 00:00:00 2001 From: Cayan <1619617+Cayan@users.noreply.github.com> Date: Thu, 1 Oct 2026 23:20:22 -0300 Subject: [PATCH 1/2] Document the compile-time and runtime checks for never --- language/types/never.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/language/types/never.xml b/language/types/never.xml index 2b84103606b7..a31b7f10783f 100644 --- a/language/types/never.xml +++ b/language/types/never.xml @@ -10,6 +10,13 @@ union type declaration. Available as of PHP 8.1.0. + + A return statement in a never function is a + compile-time error, even if the return would not be + reached during execution. If control flow reaches the end of a + never function without exiting, throwing an exception, or + entering an infinite loop, a TypeError is thrown. + never is, in type theory parlance, the bottom type, meaning it is the subtype of every other type and can replace any other From d3939dbcc9aa6981909bb41cc32aa317ce23e36e Mon Sep 17 00:00:00 2001 From: Cayan <1619617+Cayan@users.noreply.github.com> Date: Sat, 3 Oct 2026 18:50:41 -0300 Subject: [PATCH 2/2] Tag TypeError with exceptionname on the never type page --- language/types/never.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/language/types/never.xml b/language/types/never.xml index a31b7f10783f..406d565b1a24 100644 --- a/language/types/never.xml +++ b/language/types/never.xml @@ -15,7 +15,7 @@ compile-time error, even if the return would not be reached during execution. If control flow reaches the end of a never function without exiting, throwing an exception, or - entering an infinite loop, a TypeError is thrown. + entering an infinite loop, a TypeError is thrown. never is, in type theory parlance, the bottom type,