com doc/ja: Fix Ticks usage example: language/control-structures/declare.xml
| From: | Yoshinari Takaoka | Date: | Thu, 11 Mar 2021 23:40:56 +0000 |
| Subject: | com doc/ja: Fix Ticks usage example: language/control-structures/declare.xml | ||
| Groups: | php.doc.ja | ||
| Request: | Send a blank email to doc-ja+get-6251@lists.php.net to get a copy of this message | ||
Commit: e1796a5b81652a26495c0d1745135ecb681fd518
Author: Yoshinari Takaoka <mumumu@mumumu.org> Fri, 12 Mar 2021 08:40:56 +0900
Parents: 9ee4ec2ff4af0de31026e968174c41306d6c0682
Branches: master
Link: http://git.php.net/?p=doc/ja.git;a=commitdiff;h=e1796a5b81652a26495c0d1745135ecb681fd518
Log:
Fix Ticks usage example
Clarify where tick events are generated, and delete the "equivalent
behavior" example which calls tick_handler() manually, because that
example isn't really suitable.
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
Closes GH-464.
Changed paths:
M language/control-structures/declare.xml
Diff:
diff --git a/language/control-structures/declare.xml b/language/control-structures/declare.xml
index ad8ae1ede4..66eefeedaa 100644
--- a/language/control-structures/declare.xml
+++ b/language/control-structures/declare.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
-<!-- EN-Revision: 7104ee97ced1768a3231588dfc0bc0d7eb1117ad Maintainer: takagi Status: ready
-->
+<!-- EN-Revision: 1075568da56078ca0631f9cb7a310f27f3388c66 Maintainer: takagi Status: ready
-->
<!-- Credits: mumumu -->
<sect1 xml:id="control-structures.declare" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink">
@@ -116,13 +116,13 @@ function tick_handler()
echo "tick_handler() called\n";
}
-register_tick_function('tick_handler');
+register_tick_function('tick_handler'); // tick イベント発生
-$a = 1;
+$a = 1; // tick イベント発生
if ($a > 0) {
- $a += 2;
- print($a);
+ $a += 2; // tick イベント発生
+ print($a); // tick イベント発生
}
?>
@@ -130,34 +130,6 @@ if ($a > 0) {
</programlisting>
</example>
</para>
- <para>
- <example>
- <title>Ticks の使用例</title>
- <programlisting role="php">
-<![CDATA[
-<?php
-
-function tick_handler()
-{
- echo "tick_handler() called\n";
-}
-
-$a = 1;
-tick_handler();
-
-if ($a > 0) {
- $a += 2;
- tick_handler();
- print($a);
- tick_handler();
-}
-tick_handler();
-
-?>
-]]>
- </programlisting>
- </example>
- </para>
<simpara>
<function>register_tick_function</function> および
<function>unregister_tick_function</function> も参照ください。