reference/datetime/datetime/getlasterrors.xml
35b75f06bcfe6ac452b8db82b4fb58d3b33180b9
...
...
@@ -1,100 +1,19 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-

4
3
<refentry xml:id="datetime.getlasterrors" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5
4
<refnamediv>
6
5
<refname>DateTime::getLastErrors</refname>
7
-
<refname>date_get_last_errors</refname>
8
-
<refpurpose>Returns the warnings and errors</refpurpose>
6
+
<refpurpose>&Alias; <methodname>DateTimeImmutable::getLastErrors</methodname></refpurpose>
9
7
</refnamediv>
10
8

11
9
<refsect1 role="description">
12
10
&reftitle.description;
13
-
<para>&style.oop;</para>
14
-
<methodsynopsis role="oop">
15
-
<modifier>public</modifier> <modifier>static</modifier> <type>array</type><methodname>DateTime::getLastErrors</methodname>
16
-
<void />
17
-
</methodsynopsis>
18
-
<para>&style.procedural;</para>
19
-
<methodsynopsis role="procedural">
20
-
<type>array</type><methodname>date_get_last_errors</methodname>
21
-
<void />
22
-
</methodsynopsis>
23
-
<para>
24
-
Returns an array of warnings and errors found while parsing
25
-
a date/time string.
26
-
</para>
27
-
</refsect1>
28
-

29
-
<refsect1 role="parameters">
30
-
&reftitle.parameters;
31
-
&no.function.parameters;
32
-
</refsect1>
33
-

34
-
<refsect1 role="returnvalues">
35
-
&reftitle.returnvalues;
36
11
<para>
37
-
Returns array containing info about warnings and errors.
12
+
&info.function.alias; <methodname>DateTimeImmutable::getLastErrors</methodname>
38
13
</para>
39
14
</refsect1>
40
15
41
-
<refsect1 role="examples">
42
-
&reftitle.examples;
43
-
<example>
44
-
<title><function>DateTime::getLastErrors</function> example</title>
45
-
<para>&style.oop;</para>
46
-
<programlisting role="php">
47
-
<![CDATA[
48
-
<?php
49
-
try {
50
-
$date = new DateTime('asdfasdf');
51
-
} catch (Exception $e) {
52
-
// For demonstration purposes only...
53
-
print_r(DateTime::getLastErrors());
54
-

55
-
// The real object oriented way to do this is
56
-
// echo $e->getMessage();
57
-
}
58
-
?>
59
-
]]>
60
-
</programlisting>
61
-
<para>&style.procedural;</para>
62
-
<programlisting role="php">
63
-
<![CDATA[
64
-
<?php
65
-
$date = date_create('asdfasdf');
66
-
print_r(date_get_last_errors());
67
-
?>
68
-
]]>
69
-
</programlisting>
70
-
&examples.outputs;
71
-
<screen>
72
-
<![CDATA[
73
-
Array
74
-
(
75
-
[warning_count] => 1
76
-
[warnings] => Array
77
-
(
78
-
[6] => Double timezone specification
79
-
)
80
-

81
-
[error_count] => 1
82
-
[errors] => Array
83
-
(
84
-
[0] => The timezone could not be found in the database
85
-
)
86
-

87
-
)
88
-
]]>
89
-
</screen>
90
-
<para>
91
-
The indexes 6, and 0 in the example output refer to the character index in the string where the error occurred.
92
-
</para>
93
-
</example>
94
-
</refsect1>
95
-

96
16
</refentry>
97
-

98
17
<!-- Keep this comment at the end of the file
99
18
Local variables:
100
19
mode: sgml
101
20