[DOC-CVS] [doc-en] master: Add reserved words restrictions for class-alias in PHP 8.5 (#5059)

[email protected] (Jordi Kroon via GitHub) Tue, 21 Apr 2026 21:01:14 +0000
Newsgroups php.doc.cvs
Message-ID <[email protected]>
Author: Jordi Kroon (jordikroon)
Committer: GitHub (web-flow)
Pusher: kamil-tekiela
Date: 2026-04-21T22:01:11+01:00

Commit: https://github.com/php/doc-en/commit/ff9181ea03ac348b2c7ff4ad07896f277cddcb1d
Raw diff: https://github.com/php/doc-en/commit/ff9181ea03ac348b2c7ff4ad07896f277cddcb1d.diff

Add reserved words restrictions for class-alias in PHP 8.5 (#5059)

Changed paths:
  M  appendices/reserved.xml
  M  reference/classobj/functions/class-alias.xml


Diff:

diff --git a/appendices/reserved.xml b/appendices/reserved.xml
index 9c50a7f5fda3..014002ea2dcd 100644
--- a/appendices/reserved.xml
+++ b/appendices/reserved.xml
@@ -567,6 +567,12 @@
         <entry>
          never (as of PHP 8.1)
         </entry>
+        <entry>
+         array (as of PHP 8.5)
+        </entry>
+        <entry>
+         callable (as of PHP 8.5)
+        </entry>
        </row>
       </tbody>
      </tgroup>
diff --git a/reference/classobj/functions/class-alias.xml b/reference/classobj/functions/class-alias.xml
index a9564e1b885b..aeed4ab6d304 100644
--- a/reference/classobj/functions/class-alias.xml
+++ b/reference/classobj/functions/class-alias.xml
@@ -18,6 +18,9 @@
    based on the user defined class <parameter>class</parameter>.
    The aliased class is exactly the same as the original class.
   </para>
+  <simpara>
+   The class alias cannot be any of the PHP <link linkend="reserved.other-reserved-words">reserved words</link>.
+  </simpara>
    <note>
    <simpara>
     As of PHP 8.3.0, <function>class_alias</function> also supports