source: www/manuals/PHP_manual/phpdevel-errors.html@ 1

Last change on this file since 1 was 1, checked in by george, 17 years ago

Prvotní import všeho

File size: 6.0 KB
Line 
1<HTML
2><HEAD
3><TITLE
4>Reporting Errors</TITLE
5><META
6NAME="GENERATOR"
7CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
8REL="HOME"
9TITLE="Manuál PHP"
10HREF="index.html"><LINK
11REL="UP"
12TITLE="Extending PHP"
13HREF="phpdevel.html"><LINK
14REL="PREVIOUS"
15TITLE="Calling User Functions"
16HREF="calling-user-functions.html"><LINK
17REL="NEXT"
18TITLE="Seznam aliasù funkcí"
19HREF="aliases.html"><META
20HTTP-EQUIV="Content-type"
21CONTENT="text/html; charset=ISO-8859-2"></HEAD
22><BODY
23CLASS="sect1"
24BGCOLOR="#FFFFFF"
25TEXT="#000000"
26LINK="#0000FF"
27VLINK="#840084"
28ALINK="#0000FF"
29><DIV
30CLASS="NAVHEADER"
31><TABLE
32SUMMARY="Header navigation table"
33WIDTH="100%"
34BORDER="0"
35CELLPADDING="0"
36CELLSPACING="0"
37><TR
38><TH
39COLSPAN="3"
40ALIGN="center"
41>Manuál PHP</TH
42></TR
43><TR
44><TD
45WIDTH="10%"
46ALIGN="left"
47VALIGN="bottom"
48><A
49HREF="calling-user-functions.html"
50ACCESSKEY="P"
51>Pøedcházející</A
52></TD
53><TD
54WIDTH="80%"
55ALIGN="center"
56VALIGN="bottom"
57>Pøíloha E. Extending PHP</TD
58><TD
59WIDTH="10%"
60ALIGN="right"
61VALIGN="bottom"
62><A
63HREF="aliases.html"
64ACCESSKEY="N"
65>Dal¹í</A
66></TD
67></TR
68></TABLE
69><HR
70ALIGN="LEFT"
71WIDTH="100%"></DIV
72><DIV
73CLASS="sect1"
74><H1
75CLASS="sect1"
76><A
77NAME="phpdevel-errors"
78></A
79>Reporting Errors</H1
80><P
81>&#13; To report errors from an internal function, you should call the
82 <B
83CLASS="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
89HREF="function.printf.html"
90><B
91CLASS="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
98CLASS="sect2"
99><H2
100CLASS="sect2"
101><A
102NAME="internal.e-notice"
103></A
104>E_NOTICE</H2
105><P
106>&#13; 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
111HREF="function.stat.html"
112><B
113CLASS="function"
114>stat()</B
115></A
116> on a file that doesn't exist.
117 </P
118></DIV
119><DIV
120CLASS="sect2"
121><H2
122CLASS="sect2"
123><A
124NAME="internal.e-warning"
125></A
126>E_WARNING</H2
127><P
128>&#13; 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
132HREF="function.ereg.html"
133><B
134CLASS="function"
135>ereg()</B
136></A
137> with an invalid regular expression.
138 </P
139></DIV
140><DIV
141CLASS="sect2"
142><H2
143CLASS="sect2"
144><A
145NAME="internal.e-error"
146></A
147>E_ERROR</H2
148><P
149>&#13; 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
155CLASS="sect2"
156><H2
157CLASS="sect2"
158><A
159NAME="internal.e-parse"
160></A
161>E_PARSE</H2
162><P
163>&#13; 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
168CLASS="sect2"
169><H2
170CLASS="sect2"
171><A
172NAME="internal.e-core-error"
173></A
174>E_CORE_ERROR</H2
175><P
176>&#13; 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
181CLASS="sect2"
182><H2
183CLASS="sect2"
184><A
185NAME="internal.e-core-warning"
186></A
187>E_CORE_WARNING</H2
188><P
189>&#13; 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
194CLASS="sect2"
195><H2
196CLASS="sect2"
197><A
198NAME="internal.e-compile-error"
199></A
200>E_COMPILE_ERROR</H2
201><P
202>&#13; 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
207CLASS="sect2"
208><H2
209CLASS="sect2"
210><A
211NAME="internal.e-compile-warning"
212></A
213>E_COMPILE_WARNING</H2
214><P
215>&#13; 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
220CLASS="sect2"
221><H2
222CLASS="sect2"
223><A
224NAME="internal.e-user-error"
225></A
226>E_USER_ERROR</H2
227><P
228>&#13; This is like an E_ERROR, except it is generated in PHP code by using
229 the PHP function <A
230HREF="function.trigger-error.html"
231><B
232CLASS="function"
233>trigger_error()</B
234></A
235>. Functions should
236 not generate this type of error.
237 </P
238></DIV
239><DIV
240CLASS="sect2"
241><H2
242CLASS="sect2"
243><A
244NAME="internal.e-user-warning"
245></A
246>E_USER_WARNING</H2
247><P
248>&#13; This is like an E_WARNING, except it is generated by using the PHP
249 function <A
250HREF="function.trigger-error.html"
251><B
252CLASS="function"
253>trigger_error()</B
254></A
255>. Functions should not
256 generate this type of error.
257 </P
258></DIV
259><DIV
260CLASS="sect2"
261><H2
262CLASS="sect2"
263><A
264NAME="internal.e-user-notice"
265></A
266>E_USER_NOTICE</H2
267><P
268>&#13; This is like an E_NOTICE, except it is generated by using the PHP
269 function <A
270HREF="function.trigger-error.html"
271><B
272CLASS="function"
273>trigger_error()</B
274></A
275>. Functions should not
276 generate this type of error.
277 </P
278></DIV
279><DIV
280CLASS="sect2"
281><H2
282CLASS="sect2"
283><A
284NAME="internal.e-all"
285></A
286>E_ALL</H2
287><P
288>&#13; All of the above. Using this error_reporting level will show
289 all error types.
290 </P
291></DIV
292></DIV
293><DIV
294CLASS="NAVFOOTER"
295><HR
296ALIGN="LEFT"
297WIDTH="100%"><TABLE
298SUMMARY="Footer navigation table"
299WIDTH="100%"
300BORDER="0"
301CELLPADDING="0"
302CELLSPACING="0"
303><TR
304><TD
305WIDTH="33%"
306ALIGN="left"
307VALIGN="top"
308><A
309HREF="calling-user-functions.html"
310ACCESSKEY="P"
311>Pøedcházející</A
312></TD
313><TD
314WIDTH="34%"
315ALIGN="center"
316VALIGN="top"
317><A
318HREF="index.html"
319ACCESSKEY="H"
320>Domù</A
321></TD
322><TD
323WIDTH="33%"
324ALIGN="right"
325VALIGN="top"
326><A
327HREF="aliases.html"
328ACCESSKEY="N"
329>Dal¹í</A
330></TD
331></TR
332><TR
333><TD
334WIDTH="33%"
335ALIGN="left"
336VALIGN="top"
337>Calling User Functions</TD
338><TD
339WIDTH="34%"
340ALIGN="center"
341VALIGN="top"
342><A
343HREF="phpdevel.html"
344ACCESSKEY="U"
345>Nahoru</A
346></TD
347><TD
348WIDTH="33%"
349ALIGN="right"
350VALIGN="top"
351>Seznam aliasù funkcí</TD
352></TR
353></TABLE
354></DIV
355></BODY
356></HTML
357>
Note: See TracBrowser for help on using the repository browser.