From 300788af82db7e6a2fa069d1aa7a7f150e709160 Mon Sep 17 00:00:00 2001 From: lacatoire Date: Wed, 18 Feb 2026 11:38:51 +0100 Subject: [PATCH] Document ValueError thrown by settype() since PHP 8.0 Add Errors/Exceptions section and changelog entry. Fixes php/doc-en#3431 --- reference/var/functions/settype.xml | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/reference/var/functions/settype.xml b/reference/var/functions/settype.xml index 3700d30e64ab..0cf24423dc77 100644 --- a/reference/var/functions/settype.xml +++ b/reference/var/functions/settype.xml @@ -87,6 +87,41 @@ + + &reftitle.errors; + + Throws a ValueError if the value of + type is not a valid type, as of PHP 8.0.0. + Prior to PHP 8.0.0, a E_WARNING was emitted + and &false; was returned. + + + + + &reftitle.changelog; + + + + + &Version; + &Description; + + + + + 8.0.0 + + Now throws a ValueError when an invalid + type is passed to type. Previously, a + E_WARNING was emitted and the function returned + &false;. + + + + + + + &reftitle.examples;