Skip to content

Commit be767e1

Browse files
committed
docs: add reserved words restrictions for class-alias in PHP 8.5
Update reserved words documentation to include array and callable as reserved words as of PHP 8.5. Clarify in class_alias() function that aliases cannot use reserved words, with link to reserved words reference.
1 parent 3061900 commit be767e1

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

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
@@ -17,6 +17,9 @@
1717
Creates an alias named <parameter>alias</parameter>
1818
based on the user defined class <parameter>class</parameter>.
1919
The aliased class is exactly the same as the original class.
20+
</para>
21+
<para>
22+
The class alias cannot be any of the PHP <link linkend="reserved.other-reserved-words">reserved words</link>.
2023
</para>
2124
<note>
2225
<simpara>

0 commit comments

Comments
 (0)