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

4
+
<refentry xml:id="function.runkit7-function-redefine" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5
+
<refnamediv>
6
+
<refname>runkit7_function_redefine</refname>
7
+
<refpurpose>
8
+
Replace a function definition with a new implementation
9
+
</refpurpose>
10
+
</refnamediv>
11
+

12
+
<refsect1 role="description">
13
+
&reftitle.description;
14
+
<methodsynopsis>
15
+
<type>bool</type><methodname>runkit7_function_redefine</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_redefine</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
+

33
+
&note.runkit.internal-override;
34
+

35
+
</refsect1>
36
+

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

107
+
<refsect1 role="returnvalues">
108
+
&reftitle.returnvalues;
109
+
<para>
110
+
&return.success;
111
+
</para>
112
+
</refsect1>
113
+

114
+
<refsect1 role="examples">
115
+
&reftitle.examples;
116
+
<para>
117
+
<example>
118
+
<title>A <function>runkit7_function_redefine</function> example</title>
119
+
<programlisting role="php">
120
+
<![CDATA[
121
+
<?php
122
+
function testme() {
123
+
echo "Original Testme Implementation\n";
124
+
}
125
+
testme();
126
+
runkit7_function_redefine('testme','','echo "New Testme Implementation\n";');
127
+
testme();
128
+
?>
129
+
]]>
130
+
</programlisting>
131
+
&example.outputs;
132
+
<screen>
133
+
<![CDATA[
134
+
Original Testme Implementation
135
+
New Testme Implementation
136
+
]]>
137
+
</screen>
138
+
</example>
139
+
</para>
140
+
</refsect1>
141
+

142
+
<refsect1 role="seealso">
143
+
&reftitle.seealso;
144
+
<para>
145
+
<simplelist>
146
+
<member><function>runkit7_function_add</function></member>
147
+
<member><function>runkit7_function_copy</function></member>
148
+
<member><function>runkit7_function_rename</function></member>
149
+
<member><function>runkit7_function_remove</function></member>
150
+
<member><function>runkit7_method_redefine</function></member>
151
+
</simplelist>
152
+
</para>
153
+
</refsect1>
154
+

155
+
</refentry>
156
+

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