File: reserved.xml

package info (click to toggle)
php-doc 20100521-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 59,992 kB
  • ctags: 4,085
  • sloc: xml: 796,833; php: 21,338; cpp: 500; sh: 117; makefile: 58; awk: 28
file content (446 lines) | stat: -rw-r--r-- 12,168 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 297201 $ -->

 <appendix xml:id="reserved" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
  <title>List of Reserved Words</title>
  <para>
   The following is a listing of predefined identifiers in PHP. None
   of the identifiers listed here should be used as identifiers in any of
   your scripts. These lists include keywords and predefined variable,
   constant, and class names. These lists are neither exhaustive or
   complete.
  </para>

  <sect1 xml:id="reserved.keywords">
  <title>List of Keywords</title>
   <simpara>
    These words have special meaning in PHP. Some of them represent things 
    which look like functions, some look like constants, and so on--but 
    they're not, really: they are language constructs. You cannot use any
    of the following words as constants, class names, function or method names. 
    Using them as variable names is generally OK, but could lead to confusion.
   </simpara>

   <table>
    <title>PHP Keywords</title>
    <tgroup cols="5">
     <tbody>
      <row>
       <entry>
        <link linkend="language.oop5.abstract">abstract</link> (as of PHP 5)
       </entry>
       <entry>
        <link linkend="language.operators.logical">and</link>
       </entry>
       <entry>
        <function>array</function>
       </entry>
       <entry>
        <link linkend="control-structures.foreach">as</link>
       </entry>
       <entry>
        <link linkend="control-structures.break">break</link>
       </entry>
      </row>
      <row>
       <entry>
        <link linkend="control-structures.switch">case</link>
       </entry>
       <entry>
        <link linkend="language.exceptions">catch</link> (as of PHP 5)
       </entry>
       <entry>
        cfunction (PHP 4 only)
       </entry>
       <entry>
        <link linkend="keyword.class">class</link>
       </entry>
       <entry>
        <link linkend="language.oop5.cloning">clone</link> (as of PHP 5)
       </entry>
      </row>
      <row>
       <entry>
        <link linkend="language.oop5.constants">const</link>
       </entry>
       <entry>
        <link linkend="control-structures.continue">continue</link>
       </entry>
       <entry>
        <link linkend="control-structures.declare">declare</link>
       </entry>
       <entry>
        <link linkend="control-structures.switch">default</link>
       </entry>
       <entry>
        <link linkend="control-structures.do.while">do</link>
       </entry>
      </row>
      <row>
       <entry>
        <link linkend="control-structures.else">else</link>
       </entry>
       <entry>
        <link linkend="control-structures.elseif">elseif</link>
       </entry>
       <entry>
        <link linkend="control-structures.declare">enddeclare</link>
       </entry>
       <entry>
        <link linkend="control-structures.alternative-syntax">endfor</link>
       </entry>
       <entry>
        <link linkend="control-structures.alternative-syntax">endforeach</link>
       </entry>
      </row>
      <row>
       <entry>
        <link linkend="control-structures.alternative-syntax">endif</link>
       </entry>
       <entry>
        <link linkend="control-structures.alternative-syntax">endswitch</link>
       </entry>
       <entry>
        <link linkend="control-structures.alternative-syntax">endwhile</link>
       </entry>
       <entry>
        <link linkend="keyword.class">extends</link>
       </entry>
       <entry>
        <link linkend="language.oop5.final">final</link> (as of PHP 5)
       </entry>
      </row>
      <row>
       <entry>
        <link linkend="control-structures.for">for</link>
       </entry>
       <entry>
        &foreach;
       </entry>
       <entry>
        <link linkend="functions.user-defined">function</link>
       </entry>
       <entry>
        <link linkend="language.variables.scope">global</link>
       </entry>
       <entry>
        <link linkend="control-structures.goto">goto</link> (as of PHP 5.3)
       </entry>
      </row>
      <row>
       <entry>
        <link linkend="control-structures.if">if</link>
       </entry>
       <entry>
        <link linkend="language.oop5.interfaces">implements</link> (as of PHP 5)
       </entry>
       <entry>
        <link linkend="language.oop5.interfaces">interface</link> (as of PHP 5)
       </entry>
       <entry>
        <link linkend="language.operators.type">instanceof</link> (as of PHP 5)
       </entry>
      </row>
      <row>
       <entry>
        <link linkend="language.namespaces">namespace</link> (as of PHP 5.3)
       </entry>
       <entry>
        <link linkend="keyword.class">new</link>
       </entry>
       <entry>
        old_function (PHP 4 only)
       </entry>
       <entry>
        <link linkend="language.operators.logical">or</link>
       </entry>
       <entry>
        <link linkend="language.oop5.visibility">private</link> (as of PHP 5)
       </entry>
      </row>
      <row>
       <entry>
        <link linkend="language.oop5.visibility">protected</link> (as of PHP 5)
       </entry>
       <entry>
        <link linkend="language.oop5.visibility">public</link> (as of PHP 5)
       </entry>
       <entry>
        <link linkend="language.variables.scope">static</link>
       </entry>
       <entry>
        <link linkend="control-structures.switch">switch</link>
       </entry>
       <entry>
        <link linkend="language.exceptions">throw</link> (as of PHP 5)
       </entry>
      </row>
      <row>
       <entry>
        <link linkend="language.exceptions">try</link> (as of PHP 5)
       </entry>
       <entry>
        <link linkend="language.namespaces">use</link>
       </entry>
       <entry>
        <link linkend="keyword.class">var</link>
       </entry>
       <entry>
        <link linkend="control-structures.while">while</link>
       </entry>
       <entry>
        <link linkend="language.operators.logical">xor</link>
       </entry>
      </row>
     </tbody>
    </tgroup>
   </table>
   <table>
    <title>Compile-time constants</title>
    <tgroup cols="5">
     <tbody>
      <row>
       <entry>
        <link linkend="language.constants.predefined">__CLASS__</link>
       </entry>
       <entry> 
        <link linkend="language.constants.predefined">__DIR__</link> (as of PHP 5.3)
       </entry>
       <entry>
        <link linkend="language.constants.predefined">__FILE__</link>
       </entry>
       <entry>
        <link linkend="language.constants.predefined">__FUNCTION__</link>
       </entry>
       <entry>
        <link linkend="language.constants.predefined">__METHOD__</link>
       </entry>
      </row>
      <row>
       <entry>
        <link linkend="language.namespaces">__NAMESPACE__</link> (as of PHP 5.3)
       </entry>
       <entry>
       </entry>
       <entry>
       </entry>
       <entry>
       </entry>
       <entry>
       </entry>
      </row>
     </tbody>
    </tgroup>
   </table>
   <table>
    <title>Language constructs</title>
    <tgroup cols="5">
     <tbody>
      <row>
       <entry>
        <function>die</function>
       </entry>
       <entry>
        <function>echo</function>
       </entry>
       <entry>
        <function>empty</function>
       </entry>
       <entry>
        <function>exit</function>
       </entry>
       <entry>
        <function>eval</function>
       </entry>
      </row>
      <row>
       <entry>
        <function>include</function>
       </entry>
       <entry>
        <function>include_once</function>
       </entry>
       <entry>
        <function>isset</function>
       </entry>
       <entry>
        <function>list</function>
       </entry>
       <entry>
        <function>require</function>
       </entry>
      </row>
      <row>
       <entry>
        <function>require_once</function>
       </entry>
       <entry>
        <function>return</function>
       </entry>
       <entry>
        <function>print</function>
       </entry>
       <entry>
        <function>unset</function>
       </entry>
       <entry>
       </entry>
      </row>
     </tbody>
    </tgroup>
   </table>
  </sect1>

  <sect1 xml:id="reserved.classes">
   <title>Predefined Classes</title>
   <para>
    This section lists standard predefined classes. Miscellaneous extensions
    define other classes which are described in their reference.
   </para>

   <sect2 xml:id="reserved.classes.standard">
    <title>Standard Defined Classes</title>

    <simpara>
     These classes are defined in the standard set of functions included
     in the PHP build.
    </simpara>

    <variablelist>
     <varlistentry>
      <term><classname>Directory</classname></term>
      <listitem>
       <simpara>
        The class from which <link linkend="class.dir">dir</link> is instantiated.
       </simpara>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term><classname>stdClass</classname></term>
      <listitem>
       <simpara>
        Created by <link linkend="language.types.object.casting">typecasting
        to object</link>.
       </simpara>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term><classname>__PHP_Incomplete_Class</classname></term>
      <listitem>
       <simpara>
        Possibly created by <function>unserialize</function>.
       </simpara>
      </listitem>
     </varlistentry>
    </variablelist>
   </sect2>
   
   <sect2 xml:id="reserved.classes.php5">
    <title>Predefined classes as of PHP 5</title>
    
    <simpara>
     These additional predefined classes were introduced in 
     PHP 5.0.0.
    </simpara>
    
    <variablelist>
     <varlistentry>
      <term><classname>exception</classname></term>
      <listitem>
       <simpara>
       </simpara>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term><classname>php_user_filter</classname></term>
      <listitem>
       <simpara>
       </simpara>
      </listitem>
     </varlistentry>
    </variablelist>
   </sect2>

   <sect2 xml:id="reserved.classes.closure">
    <title>Closure</title>
    
    <simpara>
     The predefined final class <classname>Closure</classname> was introduced
     in PHP 5.3.0. It is used for internal implementation of <link
     linkend="functions.anonymous">anonymous functions</link>.
    </simpara>
    <simpara>
     The class has a constructor forbidding the manual creation of the object
     (issues <constant>E_RECOVERABLE_ERROR</constant>) and the
     <literal>__invoke</literal> method with the <link
     linkend="language.oop5.magic.invoke">calling magic</link>.
    </simpara>
    
   </sect2>


   <sect2 xml:id="reserved.classes.special">
    <title>Special classes</title>
    
    <simpara>
     Following identifiers may not be used as a class name as they have
     special purpose.
    </simpara>
    
    <variablelist>
     <varlistentry>
      <term><classname>self</classname></term>
      <listitem>
       <simpara>
        <link linkend="language.oop5.paamayim-nekudotayim">Current
        class</link>.
       </simpara>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term><classname>static</classname></term>
      <listitem>
       <simpara>
        <link linkend="language.oop5.late-static-bindings">Current class in
        runtime</link>.
       </simpara>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term><classname>parent</classname></term>
      <listitem>
       <simpara>
        <link linkend="language.oop5.paamayim-nekudotayim">Parent
        class</link>.
       </simpara>
      </listitem>
     </varlistentry>
    </variablelist>
   </sect2>

  </sect1>

  &appendices.reserved.constants;

</appendix>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->