svn: /phpdoc/ja/trunk/language/ control-structures/continue.xml predefined/errorexception.xml
| From: | TAKAGI Masahiro | Date: | Thu, 20 Nov 2014 22:12:40 +0000 |
| Subject: | svn: /phpdoc/ja/trunk/language/ control-structures/continue.xml predefined/errorexception.xml | ||
| Groups: | php.doc.ja | ||
| Request: | Send a blank email to doc-ja+get-4299@lists.php.net to get a copy of this message | ||
takagi Thu, 20 Nov 2014 22:12:40 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=335202
Log:
Sync with en
Changed paths:
U phpdoc/ja/trunk/language/control-structures/continue.xml
U phpdoc/ja/trunk/language/predefined/errorexception.xml
Modified: phpdoc/ja/trunk/language/control-structures/continue.xml
===================================================================
--- phpdoc/ja/trunk/language/control-structures/continue.xml 2014-11-20 21:58:35 UTC (rev 335201)
+++ phpdoc/ja/trunk/language/control-structures/continue.xml 2014-11-20 22:12:40 UTC (rev 335202)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
-<!-- EN-Revision: 325967 Maintainer: takagi Status: ready -->
+<!-- EN-Revision: 335197 Maintainer: takagi Status: ready -->
<sect1 xml:id="control-structures.continue" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink">
<title><literal>continue</literal></title>
@@ -82,7 +82,7 @@
]]>
</screen>
<para>
- しかし、このスクリプトの出力は以下のようになります。
+ しかし、PHP 5.4.0
より前のバージョンでは、このスクリプトの出力は以下のようになります。
</para>
<screen>
<![CDATA[
@@ -96,6 +96,12 @@
(<literal>print</literal> の返り値が <literal>continue</literal>
への数値引数として渡されます)。
</para>
+ <note>
+ <para>
+ PHP 5.4.0 移行では、先ほどの例を実行すると
+ <constant>E_COMPILE_ERROR</constant>
エラーが発生するようになりました。
+ </para>
+ </note>
</informalexample>
</para>
<para>
Modified: phpdoc/ja/trunk/language/predefined/errorexception.xml
===================================================================
--- phpdoc/ja/trunk/language/predefined/errorexception.xml 2014-11-20 21:58:35 UTC (rev 335201)
+++ phpdoc/ja/trunk/language/predefined/errorexception.xml 2014-11-20 22:12:40 UTC (rev 335202)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
-<!-- EN-Revision: 332523 Maintainer: satoruyoshida Status: ready -->
+<!-- EN-Revision: 335199 Maintainer: satoruyoshida Status: ready -->
<phpdoc:exceptionref xml:id="class.errorexception"
xmlns="http://docbook.org/ns/docbook"
@@ -85,6 +85,10 @@
<![CDATA[
<?php
function exception_error_handler($errno, $errstr, $errfile, $errline ) {
+ if (!(error_reporting() & $errno)) {
+ // このエラーコードが error_reporting に含まれていない場合
+ return;
+ }
throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
}
set_error_handler("exception_error_handler");
@@ -97,12 +101,12 @@
&example.outputs.similar;
<screen>
<![CDATA[
-Fatal error: Uncaught exception 'ErrorException' with message 'Wrong parameter count
for strpos()' in /home/bjori/tmp/ex.php:8
+Fatal error: Uncaught exception 'ErrorException' with message 'strpos() expects at
least 2 parameters, 0 given' in /home/bjori/tmp/ex.php:12
Stack trace:
-#0 [internal function]: exception_error_handler(2, 'Wrong parameter...',
'/home/bjori/php...', 8, Array)
-#1 /home/bjori/php/cleandocs/test.php(8): strpos()
+#0 [internal function]: exception_error_handler(2, 'strpos() expect...',
'/home/bjori/php...', 12, Array)
+#1 /home/bjori/php/cleandocs/test.php(12): strpos()
#2 {main}
- thrown in /home/bjori/tmp/ex.php on line 8
+ thrown in /home/bjori/tmp/ex.php on line 12
]]>
</screen>
</example><!-- }}} -->