Skip to content

Commit ff9181e

Browse files
authored
Add reserved words restrictions for class-alias in PHP 8.5 (#5059)
1 parent ee5ee84 commit ff9181e

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

appendices/reserved.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,12 @@
567567
<entry>
568568
never (as of PHP 8.1)
569569
</entry>
570+
<entry>
571+
array (as of PHP 8.5)
572+
</entry>
573+
<entry>
574+
callable (as of PHP 8.5)
575+
</entry>
570576
</row>
571577
</tbody>
572578
</tgroup>

reference/classobj/functions/class-alias.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
based on the user defined class <parameter>class</parameter>.
1919
The aliased class is exactly the same as the original class.
2020
</para>
21+
<simpara>
22+
The class alias cannot be any of the PHP <link linkend="reserved.other-reserved-words">reserved words</link>.
23+
</simpara>
2124
<note>
2225
<simpara>
2326
As of PHP 8.3.0, <function>class_alias</function> also supports

0 commit comments

Comments
 (0)