Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions language/types/callable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -125,7 +126,7 @@ call_user_func($c, 'PHP!');
<para>
<example>
<title>
Callback example using a Closure
Callback example using a <link linkend="class.closure">Closure</link>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, why do we have <type> and <function> but not <class>?

</title>
<programlisting role="php">
<![CDATA[
Expand Down