reference/runkit7/functions/runkit7-function-add.xml
917c06eac884740ef9285f59387a3f5259d66722
...
...
@@ -0,0 +1,171 @@
1
+
<?xml version="1.0" encoding="utf-8"?>
2
+
<!-- $Revision$ -->
3
+

4
+
<refentry xml:id="function.runkit7-function-add" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5
+
<refnamediv>
6
+
<refname>runkit7_function_add</refname>
7
+
<refpurpose>
8
+
Add a new function, similar to <function>create_function</function>
9
+
</refpurpose>
10
+
</refnamediv>
11
+

12
+
<refsect1 role="description">
13
+
&reftitle.description;
14
+
<methodsynopsis>
15
+
<type>bool</type><methodname>runkit7_function_add</methodname>
16
+
<methodparam><type>string</type><parameter>function_name</parameter></methodparam>
17
+
<methodparam><type>string</type><parameter>argument_list</parameter></methodparam>
18
+
<methodparam><type>string</type><parameter>code</parameter></methodparam>
19
+
<methodparam choice="opt"><type>bool</type><parameter>return_by_reference</parameter><initializer>&null;</initializer></methodparam>
20
+
<methodparam choice="opt"><type>string</type><parameter>doc_comment</parameter><initializer>&null;</initializer></methodparam>
21
+
<methodparam choice="opt"><type>string</type><parameter>return_type</parameter></methodparam>
22
+
<methodparam choice="opt"><type>bool</type><parameter>is_strict</parameter></methodparam>
23
+
</methodsynopsis>
24
+
<methodsynopsis>
25
+
<type>bool</type><methodname>runkit7_function_add</methodname>
26
+
<methodparam><type>string</type><parameter>function_name</parameter></methodparam>
27
+
<methodparam><type>Closure</type><parameter>closure</parameter></methodparam>
28
+
<methodparam choice="opt"><type>string</type><parameter>doc_comment</parameter><initializer>&null;</initializer></methodparam>
29
+
<methodparam choice="opt"><type>string</type><parameter>return_type</parameter></methodparam>
30
+
<methodparam choice="opt"><type>bool</type><parameter>is_strict</parameter></methodparam>
31
+
</methodsynopsis>
32
+
</refsect1>
33
+

34
+
<refsect1 role="parameters">
35
+
&reftitle.parameters;
36
+
<variablelist>
37
+
<varlistentry>
38
+
<term><parameter>function_name</parameter></term>
39
+
<listitem>
40
+
<para>
41
+
Name of the function to be created
42
+
</para>
43
+
</listitem>
44
+
</varlistentry>
45
+
<varlistentry>
46
+
<term><parameter>argument_list</parameter></term>
47
+
<listitem>
48
+
<para>
49
+
Comma separated argument list
50
+
</para>
51
+
</listitem>
52
+
</varlistentry>
53
+
<varlistentry>
54
+
<term><parameter>code</parameter></term>
55
+
<listitem>
56
+
<para>
57
+
Code making up the function
58
+
</para>
59
+
</listitem>
60
+
</varlistentry>
61
+
<varlistentry>
62
+
<term><parameter>closure</parameter></term>
63
+
<listitem>
64
+
<para>
65
+
A <classname>closure</classname> that defines the function.
66
+
</para>
67
+
</listitem>
68
+
</varlistentry>
69
+
<varlistentry>
70
+
<term><parameter>return_by_reference</parameter></term>
71
+
<listitem>
72
+
<para>
73
+
Whether the function should return by reference.
74
+
</para>
75
+
</listitem>
76
+
</varlistentry>
77
+
<varlistentry>
78
+
<term><parameter>doc_comment</parameter></term>
79
+
<listitem>
80
+
<para>
81
+
The doc comment of the function.
82
+
</para>
83
+
</listitem>
84
+
</varlistentry>
85
+
<varlistentry>
86
+
<term><parameter>return_type</parameter></term>
87
+
<listitem>
88
+
<para>
89
+
The return type of the function.
90
+
</para>
91
+
</listitem>
92
+
</varlistentry>
93
+
<varlistentry>
94
+
<term><parameter>is_strict</parameter></term>
95
+
<listitem>
96
+
<para>
97
+
Whether the function should behave as if it were declared in a file with <literal>strict_types=1</literal>
98
+
</para>
99
+
</listitem>
100
+
</varlistentry>
101
+
</variablelist>
102
+
</refsect1>
103
+

104
+
<refsect1 role="returnvalues">
105
+
&reftitle.returnvalues;
106
+
<para>
107
+
&return.success;
108
+
109
+
</para>
110
+
</refsect1>
111
+
<refsect1 role="examples">
112
+
&reftitle.examples;
113
+
<para>
114
+
<example>
115
+
<title>A <function>runkit7_function_add</function> example</title>
116
+
<programlisting role="php">
117
+
<![CDATA[
118
+
<?php
119
+
runkit7_function_add('testme','$a,$b','echo "The value of a is $a\n"; echo "The value of b is $b\n";');
120
+
testme(1,2);
121
+
?>
122
+
]]>
123
+
</programlisting>
124
+
&example.outputs;
125
+
<screen>
126
+
<![CDATA[
127
+
The value of a is 1
128
+
The value of b is 2
129
+
]]>
130
+
</screen>
131
+
</example>
132
+
</para>
133
+
</refsect1>
134
+

135
+
<refsect1 role="seealso">
136
+
&reftitle.seealso;
137
+
<para>
138
+
<simplelist>
139
+
<member><function>create_function</function></member>
140
+
<member><function>runkit7_function_redefine</function></member>
141
+
<member><function>runkit7_function_copy</function></member>
142
+
<member><function>runkit7_function_rename</function></member>
143
+
<member><function>runkit7_function_remove</function></member>
144
+
<member><function>runkit7_method_add</function></member>
145
+
</simplelist>
146
+
</para>
147
+
</refsect1>
148
+

149
+

150
+
</refentry>
151
+

152
+
<!-- Keep this comment at the end of the file
153
+
Local variables:
154
+
mode: sgml
155
+
sgml-omittag:t
156
+
sgml-shorttag:t
157
+
sgml-minimize-attributes:nil
158
+
sgml-always-quote-attributes:t
159
+
sgml-indent-step:1
160
+
sgml-indent-data:t
161
+
indent-tabs-mode:nil
162
+
sgml-parent-document:nil
163
+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
164
+
sgml-exposed-tags:nil
165
+
sgml-local-catalogs:nil
166
+
sgml-local-ecat-files:nil
167
+
End:
168
+
vim600: syn=xml fen fdm=syntax fdl=2 si
169
+
vim: et tw=78 syn=sgml
170
+
vi: ts=1 sw=1
171
+
-->
0
172