language/predefined/closure/fromcallable.xml
9c74079f12d67cabb52c124d761f48275417d7eb
...
...
@@ -1,6 +1,5 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-

4
3
<refentry xml:id="closure.fromcallable" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5
4
<refnamediv>
6
5
<refname>Closure::fromCallable</refname>
...
...
@@ -9,24 +8,29 @@
9
8

10
9
<refsect1 role="description">
11
10
&reftitle.description;
12
-
<methodsynopsis>
11
+
<methodsynopsis role="Closure">
13
12
<modifier>public</modifier> <modifier>static</modifier> <type>Closure</type><methodname>Closure::fromCallable</methodname>
14
-
<methodparam><type>callable</type><parameter>callable</parameter></methodparam>
13
+
<methodparam><type>callable</type><parameter>callback</parameter></methodparam>
15
14
</methodsynopsis>
16
15
<para>
17
16
Create and return a new <link linkend="functions.anonymous">anonymous
18
-
function</link> from given <parameter>callable</parameter> using the
19
-
current scope. This method checks if the <parameter>callable</parameter> is
17
+
function</link> from given <parameter>callback</parameter> using the
18
+
current scope. This method checks if the <parameter>callback</parameter> is
20
19
callable in the current scope and throws a <classname>TypeError</classname>
21
20
if it is not.
22
21
</para>
22
+
<note>
23
+
<para>
24
+
As of PHP 8.1.0, <link linkend="functions.first_class_callable_syntax">First class callable syntax</link> has the same semantics as this method.
25
+
</para>
26
+
</note>
23
27
</refsect1>
24
28

25
29
<refsect1 role="parameters">
26
30
&reftitle.parameters;
27
31
<variablelist>
28
32
<varlistentry>
29
-
<term><parameter>callable</parameter></term>
33
+
<term><parameter>callback</parameter></term>
30
34
<listitem>
31
35
<para>
32
36
The callable to convert.
...
...
@@ -40,12 +44,20 @@
40
44
&reftitle.returnvalues;
41
45
<para>
42
46
Returns the newly created <classname>Closure</classname> or throws a
43
-
<classname>TypeError</classname> if the <parameter>callable</parameter> is
47
+
<classname>TypeError</classname> if the <parameter>callback</parameter> is
44
48
not callable in the current scope.
45
49
</para>
46
50
</refsect1>
47
-
</refentry>
48
51

52
+
<refsect1 role="seealso">
53
+
&reftitle.seealso;
54
+
<simplelist>
55
+
<member><link linkend="functions.anonymous">Anonymous functions</link></member>
56
+
<member><link linkend="functions.first_class_callable_syntax">First class callable syntax</link></member>
57
+
</simplelist>
58
+
</refsect1>
59
+

60
+
</refentry>
49
61
<!-- Keep this comment at the end of the file
50
62
Local variables:
51
63
mode: sgml
...
...
@@ -66,4 +78,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
66
78
vim: et tw=78 syn=sgml
67
79
vi: ts=1 sw=1
68
80
-->
69
-

70
81