[doc-en] master: Document the Error thrown by class_exists() for unresolved dependencies (#6055)

From: Date: Tue, 10 Nov 2026 14:45:38 +0000
Subject: [doc-en] master: Document the Error thrown by class_exists() for unresolved dependencies (#6055)
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-23931@lists.php.net to get a copy of this message
Author: Louis-Arnaud (lacatoire) Committer: GitHub (web-flow) Pusher: lacatoire Date: 2026-11-10T15:45:34+01:00 Commit: https://github.com/php/doc-en/commit/dae065a26aa3bb4223fcc0989d51147047e6fa02 Raw diff: https://github.com/php/doc-en/commit/dae065a26aa3bb4223fcc0989d51147047e6fa02.diff Document the Error thrown by class_exists() for unresolved dependencies (#6055) Changed paths: M reference/classobj/functions/class-exists.xml Diff: diff --git a/reference/classobj/functions/class-exists.xml b/reference/classobj/functions/class-exists.xml index a3134c40b74b..714f982f05e7 100644 --- a/reference/classobj/functions/class-exists.xml +++ b/reference/classobj/functions/class-exists.xml @@ -47,6 +47,37 @@ &false; otherwise. </para> </refsect1> + <refsect1 role="errors"> + &reftitle.errors; + <simpara> + If <parameter>autoload</parameter> is &true; and the autoloaded class + declaration needs a parent class, an interface or a trait that cannot be + found, even after autoloading, an <exceptionname>Error</exceptionname> + is thrown instead of returning &false;. + </simpara> + </refsect1> + <refsect1 role="changelog"> + &reftitle.changelog; + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>8.5.0</entry> + <entry> + A missing trait now throws an <exceptionname>Error</exceptionname> + instead of raising a fatal <constant>E_ERROR</constant>. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </refsect1> <refsect1 role="examples"> &reftitle.examples; <para>

« previous php.doc.cvs (#23931) next »