[DOC-CVS] [doc-en] master: Add note about first-class callables to callable type and add link to the closure documentation page (#4792)

[email protected] (Sebastian Hädrich via GitHub)
Newsgroups php.doc.cvs
Message-ID <[email protected]>
Author: Sebastian Hädrich (shaedrich)
Committer: GitHub (web-flow)
Pusher: kamil-tekiela
Date: 2025-10-16T00:43:01+01:00

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

Add note about first-class callables to callable type and add link to the closure documentation page (#4792)

Changed paths:
  M  language/types/callable.xml


Diff:

diff --git a/language/types/callable.xml b/language/types/callable.xml
index 240a51f42a62..d50923a89b6a 100644
--- a/language/types/callable.xml
+++ b/language/types/callable.xml
@@ -18,9 +18,10 @@
   <title>Passing</title>
 
   <para>
-   A PHP function is passed by its name as a <type>string</type>. Any built-in
-   or user-defined function can be used, except language constructs such as:
-   <function>array</function>, <function>echo</function>,
+   A PHP function is passed by either its name as a <type>string</type> or by
+   a <link linkend="functions.first_class_callable_syntax">first-class callable</link>.
+   Any built-in or user-defined function can be used, except language constructs
+   such as: <function>array</function>, <function>echo</function>,
    <function>empty</function>, <function>eval</function>,
    <function>exit</function>, <function>isset</function>,
    <function>list</function>, <function>print</function> or
@@ -125,7 +126,7 @@ call_user_func($c, 'PHP!');
   <para>
    <example>
     <title>
-     Callback example using a Closure
+     Callback example using a <classname>Closure</classname>
     </title>
    <programlisting role="php">
 <![CDATA[
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.