From cf696224661626226283cb5607b7aa0bcd96caaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=A6=E7=94=B0=20=E6=86=B2=E5=A4=AA=E9=83=8E?= Date: Thu, 29 Oct 2026 23:09:20 +0900 Subject: [PATCH] =?UTF-8?q?simplexml=20=E3=82=92=E5=8E=9F=E6=96=87?= =?UTF-8?q?=E3=81=AE=E5=A4=89=E6=9B=B4=E3=81=AB=E8=BF=BD=E5=BE=93=20(3?= =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../functions/simplexml-import-dom.xml | 14 +++---- .../functions/simplexml-load-file.xml | 38 +++++++++++++++++-- .../functions/simplexml-load-string.xml | 38 +++++++++++++++++-- 3 files changed, 77 insertions(+), 13 deletions(-) diff --git a/reference/simplexml/functions/simplexml-import-dom.xml b/reference/simplexml/functions/simplexml-import-dom.xml index cf609b3866..83215643e9 100644 --- a/reference/simplexml/functions/simplexml-import-dom.xml +++ b/reference/simplexml/functions/simplexml-import-dom.xml @@ -1,6 +1,6 @@ - + @@ -36,12 +36,12 @@ class_name - + このオプションパラメータを使用すると、 simplexml_import_dom は指定したクラスのオブジェクトを返します。このクラスは SimpleXMLElement を継承していなければなりません。 - + @@ -62,6 +62,10 @@ 非XMLまたは非HTMLのnodeが渡された場合、 TypeErrorをスローします。 + + class_name が SimpleXMLElement + でもそのサブクラスでもない場合、TypeError をスローします。 + @@ -104,10 +108,6 @@ loadXML('blah'); -if (!$dom) { - echo 'ドキュメントのパース時にエラーが発生しました'; - exit; -} $s = simplexml_import_dom($dom); diff --git a/reference/simplexml/functions/simplexml-load-file.xml b/reference/simplexml/functions/simplexml-load-file.xml index 6cf4e5ecef..34dfbebfab 100644 --- a/reference/simplexml/functions/simplexml-load-file.xml +++ b/reference/simplexml/functions/simplexml-load-file.xml @@ -1,6 +1,6 @@ - + @@ -83,9 +83,14 @@ &return.falseforfailure;。 &return.falseproblem; + + options に LIBXML_RECOVER を指定した場合は、 + 空でない入力からルート要素を復元できなくても &false; を返しません。 + 代わりに、初期化されていない SimpleXMLElement を返します。 + - + &reftitle.errors; XML データ内でエラーが見つかるたびに E_WARNING @@ -97,7 +102,34 @@ 後から libxml_get_errors で取得することもできます。 - + + options が int の範囲に収まらない場合、 + ValueError をスローします。 + + + + + &reftitle.changelog; + + + + + &Version; + &Description; + + + + + 8.0.0 + + options が int の範囲に収まらない場合、 + ValueError をスローするようになりました。 + + + + + + &reftitle.examples; diff --git a/reference/simplexml/functions/simplexml-load-string.xml b/reference/simplexml/functions/simplexml-load-string.xml index ee8881a27b..3fab39bdda 100644 --- a/reference/simplexml/functions/simplexml-load-string.xml +++ b/reference/simplexml/functions/simplexml-load-string.xml @@ -1,6 +1,6 @@ - + @@ -83,9 +83,14 @@ &return.falseforfailure;。 &return.falseproblem; + + options に LIBXML_RECOVER を指定した場合は、 + 空でない入力からルート要素を復元できなくても &false; を返しません。 + 代わりに、初期化されていない SimpleXMLElement を返します。 + - + &reftitle.errors; XML データ内でエラーが見つかるたびに E_WARNING @@ -97,7 +102,34 @@ 後から libxml_get_errors で取得することもできます。 - + + options が int の範囲に収まらない場合、 + ValueError をスローします。 + + + + + &reftitle.changelog; + + + + + &Version; + &Description; + + + + + 8.0.0 + + options が int の範囲に収まらない場合、 + ValueError をスローするようになりました。 + + + + + + &reftitle.examples;