1 | <HTML
|
---|
2 | ><HEAD
|
---|
3 | ><TITLE
|
---|
4 | >Reporting Errors</TITLE
|
---|
5 | ><META
|
---|
6 | NAME="GENERATOR"
|
---|
7 | CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
|
---|
8 | REL="HOME"
|
---|
9 | TITLE="Manuál PHP"
|
---|
10 | HREF="index.html"><LINK
|
---|
11 | REL="UP"
|
---|
12 | TITLE="Extending PHP"
|
---|
13 | HREF="phpdevel.html"><LINK
|
---|
14 | REL="PREVIOUS"
|
---|
15 | TITLE="Calling User Functions"
|
---|
16 | HREF="calling-user-functions.html"><LINK
|
---|
17 | REL="NEXT"
|
---|
18 | TITLE="Seznam aliasù funkcí"
|
---|
19 | HREF="aliases.html"><META
|
---|
20 | HTTP-EQUIV="Content-type"
|
---|
21 | CONTENT="text/html; charset=ISO-8859-2"></HEAD
|
---|
22 | ><BODY
|
---|
23 | CLASS="sect1"
|
---|
24 | BGCOLOR="#FFFFFF"
|
---|
25 | TEXT="#000000"
|
---|
26 | LINK="#0000FF"
|
---|
27 | VLINK="#840084"
|
---|
28 | ALINK="#0000FF"
|
---|
29 | ><DIV
|
---|
30 | CLASS="NAVHEADER"
|
---|
31 | ><TABLE
|
---|
32 | SUMMARY="Header navigation table"
|
---|
33 | WIDTH="100%"
|
---|
34 | BORDER="0"
|
---|
35 | CELLPADDING="0"
|
---|
36 | CELLSPACING="0"
|
---|
37 | ><TR
|
---|
38 | ><TH
|
---|
39 | COLSPAN="3"
|
---|
40 | ALIGN="center"
|
---|
41 | >Manuál PHP</TH
|
---|
42 | ></TR
|
---|
43 | ><TR
|
---|
44 | ><TD
|
---|
45 | WIDTH="10%"
|
---|
46 | ALIGN="left"
|
---|
47 | VALIGN="bottom"
|
---|
48 | ><A
|
---|
49 | HREF="calling-user-functions.html"
|
---|
50 | ACCESSKEY="P"
|
---|
51 | >Pøedcházející</A
|
---|
52 | ></TD
|
---|
53 | ><TD
|
---|
54 | WIDTH="80%"
|
---|
55 | ALIGN="center"
|
---|
56 | VALIGN="bottom"
|
---|
57 | >Pøíloha E. Extending PHP</TD
|
---|
58 | ><TD
|
---|
59 | WIDTH="10%"
|
---|
60 | ALIGN="right"
|
---|
61 | VALIGN="bottom"
|
---|
62 | ><A
|
---|
63 | HREF="aliases.html"
|
---|
64 | ACCESSKEY="N"
|
---|
65 | >Dal¹í</A
|
---|
66 | ></TD
|
---|
67 | ></TR
|
---|
68 | ></TABLE
|
---|
69 | ><HR
|
---|
70 | ALIGN="LEFT"
|
---|
71 | WIDTH="100%"></DIV
|
---|
72 | ><DIV
|
---|
73 | CLASS="sect1"
|
---|
74 | ><H1
|
---|
75 | CLASS="sect1"
|
---|
76 | ><A
|
---|
77 | NAME="phpdevel-errors"
|
---|
78 | ></A
|
---|
79 | >Reporting Errors</H1
|
---|
80 | ><P
|
---|
81 | > To report errors from an internal function, you should call the
|
---|
82 | <B
|
---|
83 | CLASS="function"
|
---|
84 | >php3_error()</B
|
---|
85 | > function. This takes at least two
|
---|
86 | parameters -- the first is the level of the error, the second is
|
---|
87 | the format string for the error message (as in a standard
|
---|
88 | <A
|
---|
89 | HREF="function.printf.html"
|
---|
90 | ><B
|
---|
91 | CLASS="function"
|
---|
92 | >printf()</B
|
---|
93 | ></A
|
---|
94 | > call), and any following arguments
|
---|
95 | are the parameters for the format string. The error levels are:
|
---|
96 | </P
|
---|
97 | ><DIV
|
---|
98 | CLASS="sect2"
|
---|
99 | ><H2
|
---|
100 | CLASS="sect2"
|
---|
101 | ><A
|
---|
102 | NAME="internal.e-notice"
|
---|
103 | ></A
|
---|
104 | >E_NOTICE</H2
|
---|
105 | ><P
|
---|
106 | > Notices are not printed by default, and indicate that the script
|
---|
107 | encountered something that could indicate an error, but could also
|
---|
108 | happen in the normal course of running a script. For example,
|
---|
109 | trying to access the value of a variable which has not been set,
|
---|
110 | or calling <A
|
---|
111 | HREF="function.stat.html"
|
---|
112 | ><B
|
---|
113 | CLASS="function"
|
---|
114 | >stat()</B
|
---|
115 | ></A
|
---|
116 | > on a file that doesn't exist.
|
---|
117 | </P
|
---|
118 | ></DIV
|
---|
119 | ><DIV
|
---|
120 | CLASS="sect2"
|
---|
121 | ><H2
|
---|
122 | CLASS="sect2"
|
---|
123 | ><A
|
---|
124 | NAME="internal.e-warning"
|
---|
125 | ></A
|
---|
126 | >E_WARNING</H2
|
---|
127 | ><P
|
---|
128 | > Warnings are printed by default, but do not interrupt script
|
---|
129 | execution. These indicate a problem that should have been trapped
|
---|
130 | by the script before the call was made. For example, calling
|
---|
131 | <A
|
---|
132 | HREF="function.ereg.html"
|
---|
133 | ><B
|
---|
134 | CLASS="function"
|
---|
135 | >ereg()</B
|
---|
136 | ></A
|
---|
137 | > with an invalid regular expression.
|
---|
138 | </P
|
---|
139 | ></DIV
|
---|
140 | ><DIV
|
---|
141 | CLASS="sect2"
|
---|
142 | ><H2
|
---|
143 | CLASS="sect2"
|
---|
144 | ><A
|
---|
145 | NAME="internal.e-error"
|
---|
146 | ></A
|
---|
147 | >E_ERROR</H2
|
---|
148 | ><P
|
---|
149 | > Errors are also printed by default, and execution of the script is
|
---|
150 | halted after the function returns. These indicate errors that can
|
---|
151 | not be recovered from, such as a memory allocation problem.
|
---|
152 | </P
|
---|
153 | ></DIV
|
---|
154 | ><DIV
|
---|
155 | CLASS="sect2"
|
---|
156 | ><H2
|
---|
157 | CLASS="sect2"
|
---|
158 | ><A
|
---|
159 | NAME="internal.e-parse"
|
---|
160 | ></A
|
---|
161 | >E_PARSE</H2
|
---|
162 | ><P
|
---|
163 | > Parse errors should only be generated by the parser. The code is
|
---|
164 | listed here only for the sake of completeness.
|
---|
165 | </P
|
---|
166 | ></DIV
|
---|
167 | ><DIV
|
---|
168 | CLASS="sect2"
|
---|
169 | ><H2
|
---|
170 | CLASS="sect2"
|
---|
171 | ><A
|
---|
172 | NAME="internal.e-core-error"
|
---|
173 | ></A
|
---|
174 | >E_CORE_ERROR</H2
|
---|
175 | ><P
|
---|
176 | > This is like an E_ERROR, except it is generated by the core
|
---|
177 | of PHP. Functions should not generate this type of error.
|
---|
178 | </P
|
---|
179 | ></DIV
|
---|
180 | ><DIV
|
---|
181 | CLASS="sect2"
|
---|
182 | ><H2
|
---|
183 | CLASS="sect2"
|
---|
184 | ><A
|
---|
185 | NAME="internal.e-core-warning"
|
---|
186 | ></A
|
---|
187 | >E_CORE_WARNING</H2
|
---|
188 | ><P
|
---|
189 | > This is like an E_WARNING, except it is generated by the core
|
---|
190 | of PHP. Functions should not generate this type of error.
|
---|
191 | </P
|
---|
192 | ></DIV
|
---|
193 | ><DIV
|
---|
194 | CLASS="sect2"
|
---|
195 | ><H2
|
---|
196 | CLASS="sect2"
|
---|
197 | ><A
|
---|
198 | NAME="internal.e-compile-error"
|
---|
199 | ></A
|
---|
200 | >E_COMPILE_ERROR</H2
|
---|
201 | ><P
|
---|
202 | > This is like an E_ERROR, except it is generated by the Zend Scripting
|
---|
203 | Engine. Functions should not generate this type of error.
|
---|
204 | </P
|
---|
205 | ></DIV
|
---|
206 | ><DIV
|
---|
207 | CLASS="sect2"
|
---|
208 | ><H2
|
---|
209 | CLASS="sect2"
|
---|
210 | ><A
|
---|
211 | NAME="internal.e-compile-warning"
|
---|
212 | ></A
|
---|
213 | >E_COMPILE_WARNING</H2
|
---|
214 | ><P
|
---|
215 | > This is like an E_WARNING, except it is generated by the Zend Scripting
|
---|
216 | Engine. Functions should not generate this type of error.
|
---|
217 | </P
|
---|
218 | ></DIV
|
---|
219 | ><DIV
|
---|
220 | CLASS="sect2"
|
---|
221 | ><H2
|
---|
222 | CLASS="sect2"
|
---|
223 | ><A
|
---|
224 | NAME="internal.e-user-error"
|
---|
225 | ></A
|
---|
226 | >E_USER_ERROR</H2
|
---|
227 | ><P
|
---|
228 | > This is like an E_ERROR, except it is generated in PHP code by using
|
---|
229 | the PHP function <A
|
---|
230 | HREF="function.trigger-error.html"
|
---|
231 | ><B
|
---|
232 | CLASS="function"
|
---|
233 | >trigger_error()</B
|
---|
234 | ></A
|
---|
235 | >. Functions should
|
---|
236 | not generate this type of error.
|
---|
237 | </P
|
---|
238 | ></DIV
|
---|
239 | ><DIV
|
---|
240 | CLASS="sect2"
|
---|
241 | ><H2
|
---|
242 | CLASS="sect2"
|
---|
243 | ><A
|
---|
244 | NAME="internal.e-user-warning"
|
---|
245 | ></A
|
---|
246 | >E_USER_WARNING</H2
|
---|
247 | ><P
|
---|
248 | > This is like an E_WARNING, except it is generated by using the PHP
|
---|
249 | function <A
|
---|
250 | HREF="function.trigger-error.html"
|
---|
251 | ><B
|
---|
252 | CLASS="function"
|
---|
253 | >trigger_error()</B
|
---|
254 | ></A
|
---|
255 | >. Functions should not
|
---|
256 | generate this type of error.
|
---|
257 | </P
|
---|
258 | ></DIV
|
---|
259 | ><DIV
|
---|
260 | CLASS="sect2"
|
---|
261 | ><H2
|
---|
262 | CLASS="sect2"
|
---|
263 | ><A
|
---|
264 | NAME="internal.e-user-notice"
|
---|
265 | ></A
|
---|
266 | >E_USER_NOTICE</H2
|
---|
267 | ><P
|
---|
268 | > This is like an E_NOTICE, except it is generated by using the PHP
|
---|
269 | function <A
|
---|
270 | HREF="function.trigger-error.html"
|
---|
271 | ><B
|
---|
272 | CLASS="function"
|
---|
273 | >trigger_error()</B
|
---|
274 | ></A
|
---|
275 | >. Functions should not
|
---|
276 | generate this type of error.
|
---|
277 | </P
|
---|
278 | ></DIV
|
---|
279 | ><DIV
|
---|
280 | CLASS="sect2"
|
---|
281 | ><H2
|
---|
282 | CLASS="sect2"
|
---|
283 | ><A
|
---|
284 | NAME="internal.e-all"
|
---|
285 | ></A
|
---|
286 | >E_ALL</H2
|
---|
287 | ><P
|
---|
288 | > All of the above. Using this error_reporting level will show
|
---|
289 | all error types.
|
---|
290 | </P
|
---|
291 | ></DIV
|
---|
292 | ></DIV
|
---|
293 | ><DIV
|
---|
294 | CLASS="NAVFOOTER"
|
---|
295 | ><HR
|
---|
296 | ALIGN="LEFT"
|
---|
297 | WIDTH="100%"><TABLE
|
---|
298 | SUMMARY="Footer navigation table"
|
---|
299 | WIDTH="100%"
|
---|
300 | BORDER="0"
|
---|
301 | CELLPADDING="0"
|
---|
302 | CELLSPACING="0"
|
---|
303 | ><TR
|
---|
304 | ><TD
|
---|
305 | WIDTH="33%"
|
---|
306 | ALIGN="left"
|
---|
307 | VALIGN="top"
|
---|
308 | ><A
|
---|
309 | HREF="calling-user-functions.html"
|
---|
310 | ACCESSKEY="P"
|
---|
311 | >Pøedcházející</A
|
---|
312 | ></TD
|
---|
313 | ><TD
|
---|
314 | WIDTH="34%"
|
---|
315 | ALIGN="center"
|
---|
316 | VALIGN="top"
|
---|
317 | ><A
|
---|
318 | HREF="index.html"
|
---|
319 | ACCESSKEY="H"
|
---|
320 | >Domù</A
|
---|
321 | ></TD
|
---|
322 | ><TD
|
---|
323 | WIDTH="33%"
|
---|
324 | ALIGN="right"
|
---|
325 | VALIGN="top"
|
---|
326 | ><A
|
---|
327 | HREF="aliases.html"
|
---|
328 | ACCESSKEY="N"
|
---|
329 | >Dal¹í</A
|
---|
330 | ></TD
|
---|
331 | ></TR
|
---|
332 | ><TR
|
---|
333 | ><TD
|
---|
334 | WIDTH="33%"
|
---|
335 | ALIGN="left"
|
---|
336 | VALIGN="top"
|
---|
337 | >Calling User Functions</TD
|
---|
338 | ><TD
|
---|
339 | WIDTH="34%"
|
---|
340 | ALIGN="center"
|
---|
341 | VALIGN="top"
|
---|
342 | ><A
|
---|
343 | HREF="phpdevel.html"
|
---|
344 | ACCESSKEY="U"
|
---|
345 | >Nahoru</A
|
---|
346 | ></TD
|
---|
347 | ><TD
|
---|
348 | WIDTH="33%"
|
---|
349 | ALIGN="right"
|
---|
350 | VALIGN="top"
|
---|
351 | >Seznam aliasù funkcí</TD
|
---|
352 | ></TR
|
---|
353 | ></TABLE
|
---|
354 | ></DIV
|
---|
355 | ></BODY
|
---|
356 | ></HTML
|
---|
357 | >
|
---|