Skip to content

Commit eac9eff

Browse files
authored
Add note about first-class callables to callable type and add link to the closure documentation page (#4792)
1 parent 71166b7 commit eac9eff

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

language/types/callable.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
<title>Passing</title>
1919

2020
<para>
21-
A PHP function is passed by its name as a <type>string</type>. Any built-in
22-
or user-defined function can be used, except language constructs such as:
23-
<function>array</function>, <function>echo</function>,
21+
A PHP function is passed by either its name as a <type>string</type> or by
22+
a <link linkend="functions.first_class_callable_syntax">first-class callable</link>.
23+
Any built-in or user-defined function can be used, except language constructs
24+
such as: <function>array</function>, <function>echo</function>,
2425
<function>empty</function>, <function>eval</function>,
2526
<function>exit</function>, <function>isset</function>,
2627
<function>list</function>, <function>print</function> or
@@ -125,7 +126,7 @@ call_user_func($c, 'PHP!');
125126
<para>
126127
<example>
127128
<title>
128-
Callback example using a Closure
129+
Callback example using a <classname>Closure</classname>
129130
</title>
130131
<programlisting role="php">
131132
<![CDATA[

0 commit comments

Comments
 (0)