1
0
mirror of https://github.com/php/doc-ja.git synced 2026-03-27 00:22:08 +01:00
Files
archived-doc-ja/reference/datetime/datetimeimmutable/getlasterrors.xml
Yoshinari Takaoka f3086c82f1 日付/時刻に関する大量更新 2022/08/13 part I.
1a9ee818e5

続きは reference/datetime/datetimeinterface/diff.xml から。
2022-08-13 16:20:29 +09:00

102 lines
2.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 1a9ee818e554e116b4721d432c6d671e14281ea0 Maintainer: takagi Status: ready -->
<refentry xml:id="datetimeimmutable.getlasterrors" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>DateTimeImmutable::getLastErrors</refname>
<refpurpose>警告およびエラーを返す</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="oop">
<modifier>public</modifier> <modifier>static</modifier> <type class="union"><type>array</type><type>false</type></type><methodname>DateTimeImmutable::getLastErrors</methodname>
<void/>
</methodsynopsis>
<para>
日付/時刻文字列のパース時に見つかった警告やエラーの配列を返します。
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
警告やエラーに関する情報を含む配列を返します。
警告やエラーがない場合は &false; を返します。
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>DateTimeImmutable::getLastErrors</function> の例</title>
<programlisting role="php">
<![CDATA[
<?php
try {
$date = new DateTimeImmutable('asdfasdf');
} catch (Exception $e) {
// 使用例を出したかっただけ...
print_r(DateTimeImmutable::getLastErrors());
// オブジェクト指向流にやるなら、本来は以下のように書くべき
// echo $e->getMessage();
}
?>
]]>
</programlisting>
&examples.outputs;
<screen>
<![CDATA[
Array
(
[warning_count] => 1
[warnings] => Array
(
[6] => Double timezone specification
)
[error_count] => 1
[errors] => Array
(
[0] => The timezone could not be found in the database
)
)
]]>
</screen>
<para>
この出力のインデックス 6 と 0 は、エラーが発生した文字列内での文字の位置を表します。
</para>
</example>
</refsect1>
</refentry>
<!-- 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
-->