reference/funchand/functions/func-get-arg.xml
de42b5016e8d9cbfd245d70f65354a86f4e2f031
...
...
@@ -10,7 +10,7 @@
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
12
<type>mixed</type><methodname>func_get_arg</methodname>
13
-
<methodparam><type>int</type><parameter>arg_num</parameter></methodparam>
13
+
<methodparam><type>int</type><parameter>position</parameter></methodparam>
14
14
</methodsynopsis>
15
15
<para>
16
16
Gets the specified argument from a user-defined function's argument list.
...
...
@@ -27,7 +27,7 @@
27
27
<para>
28
28
<variablelist>
29
29
<varlistentry>
30
-
<term><parameter>arg_num</parameter></term>
30
+
<term><parameter>position</parameter></term>
31
31
<listitem>
32
32
<para>
33
33
The argument offset. Function arguments are counted starting from
...
...
@@ -46,44 +46,11 @@
46
46
</para>
47
47
</refsect1>
48
48

49
-
<refsect1 role="changelog">
50
-
&reftitle.changelog;
51
-
<para>
52
-
<informaltable>
53
-
<tgroup cols="2">
54
-
<thead>
55
-
<row>
56
-
<entry>&Version;</entry>
57
-
<entry>&Description;</entry>
58
-
</row>
59
-
</thead>
60
-
<tbody>
61
-
<row>
62
-
<entry>5.3.0</entry>
63
-
<entry>
64
-
This function can now be used in parameter lists.
65
-
</entry>
66
-
</row>
67
-
<row>
68
-
<entry>5.3.0</entry>
69
-
<entry>
70
-
If this function is called from the outermost scope of a file
71
-
which has been included by calling <function>include</function>
72
-
or <function>require</function> from within a function in the
73
-
calling file, it now generates a warning and returns &false;.
74
-
</entry>
75
-
</row>
76
-
</tbody>
77
-
</tgroup>
78
-
</informaltable>
79
-
</para>
80
-
</refsect1>
81
-

82
49
<refsect1 role="errors">
83
50
&reftitle.errors;
84
51
<para>
85
52
Generates a warning if called from outside of a user-defined function, or
86
-
if <parameter>arg_num</parameter> is greater than the number of arguments
53
+
if <parameter>position</parameter> is greater than the number of arguments
87
54
actually passed.
88
55
</para>
89
56
</refsect1>
...
...
@@ -118,50 +85,6 @@ Second argument is: 2
118
85
</screen>
119
86
</example>
120
87
</para>
121
-
<para>
122
-
<example>
123
-
<title><function>func_get_arg</function> example before and
124
-
after PHP 5.3</title>
125
-
<programlisting role="php">
126
-
<![CDATA[
127
-
test.php
128
-
<?php
129
-
function foo() {
130
-
include './fga.inc';
131
-
}
132
-

133
-
foo('First arg', 'Second arg');
134
-
?>
135
-

136
-
fga.inc
137
-
<?php
138
-

139
-
$arg = func_get_arg(1);
140
-
var_export($arg);
141
-

142
-
?>
143
-
]]>
144
-
</programlisting>
145
-
<para>
146
-
Output previous to PHP 5.3:
147
-
</para>
148
-
<screen>
149
-
<![CDATA[
150
-
'Second arg'
151
-
]]>
152
-
</screen>
153
-
<para>
154
-
Output in PHP 5.3 and later:
155
-
</para>
156
-
<screen>
157
-
<![CDATA[
158
-
Warning: func_get_arg(): Called from the global scope - no function
159
-
context in /home/torben/Desktop/code/ml/fga.inc on line 3
160
-
false
161
-
]]>
162
-
</screen>
163
-
</example>
164
-
</para>
165
88

166
89
<para>
167
90
<example>
...
...
@@ -187,20 +110,13 @@ byRef($arg);
187
110
?>
188
111
]]>
189
112
</programlisting>
190
-
&example.outputs.7;
113
+
&example.outputs;
191
114
<screen>
192
115
As passed : 'bar'
193
116
After change : 'baz'
194
117
As passed : 'bar'
195
118
After change : 'baz'
196
119
</screen>
197
-
&example.outputs.5;
198
-
<screen>
199
-
As passed : 'bar'
200
-
After change : 'bar'
201
-
As passed : 'bar'
202
-
After change : 'baz'
203
-
</screen>
204
120
</example>
205
121
</para>
206
122

...
...
@@ -208,7 +124,7 @@ After change : 'baz'
208
124

209
125
<refsect1 role="notes">
210
126
&reftitle.notes;
211
-
&note.funcnoparam;
127
+
&note.func-named-params;
212
128
&note.funcbyref;
213
129
<note>
214
130
<simpara>
...
...
@@ -222,7 +138,7 @@ After change : 'baz'
222
138
&reftitle.seealso;
223
139
<para>
224
140
<simplelist>
225
-
<member><link linkend="functions.variable-arg-list.new"><literal>...</literal> syntax in PHP 5.6+</link></member>
141
+
<member><link linkend="functions.variable-arg-list"><literal>...</literal> syntax</link></member>
226
142
<member><function>func_get_args</function></member>
227
143
<member><function>func_num_args</function></member>
228
144
</simplelist>
...
...
@@ -230,7 +146,6 @@ After change : 'baz'
230
146
</refsect1>
231
147

232
148
</refentry>
233
-

234
149
<!-- Keep this comment at the end of the file
235
150
Local variables:
236
151
mode: sgml
237
152