@@ -36,7 +36,7 @@ declare (directive)
3636 be given as directive values. Variables and constants cannot be used. To
3737 illustrate:
3838 <informalexample >
39- <programlisting role =" php" >
39+ <programlisting role =" php" annotations = " non-interactive " >
4040<![CDATA[
4141<?php
4242// This is valid:
@@ -45,7 +45,6 @@ declare(ticks=1);
4545// This is invalid:
4646const TICK_VALUE = 1;
4747declare(ticks=TICK_VALUE);
48- ?>
4948]]>
5049 </programlisting >
5150 </informalexample >
@@ -63,7 +62,7 @@ declare(ticks=TICK_VALUE);
6362 <literal >declare</literal > was included then it does not affect the parent
6463 file).
6564 <informalexample >
66- <programlisting role =" php" >
65+ <programlisting role =" php" annotations = " non-interactive " >
6766<![CDATA[
6867<?php
6968// these are the same:
@@ -76,7 +75,6 @@ declare(ticks=1) {
7675// or you can use this:
7776declare(ticks=1);
7877// entire script here
79- ?>
8078]]>
8179 </programlisting >
8280 </informalexample >
@@ -123,12 +121,20 @@ $a = 1; // causes a tick event
123121
124122if ($a > 0) {
125123 $a += 2; // causes a tick event
126- print $a; // causes a tick event
124+ print $a . "\n" ; // causes a tick event
127125}
128-
129- ?>
130126]]>
131127 </programlisting >
128+ &example.outputs;
129+ <screen >
130+ <![CDATA[
131+ tick_handler() called
132+ tick_handler() called
133+ tick_handler() called
134+ 3
135+ tick_handler() called
136+ ]]>
137+ </screen >
132138 </example >
133139 </para >
134140 <simpara >
@@ -142,12 +148,11 @@ if ($a > 0) {
142148 A script's encoding can be specified per-script using the <literal >encoding</literal > directive.
143149 <example >
144150 <title >Declaring an encoding for the script</title >
145- <programlisting role =" php" >
151+ <programlisting role =" php" annotations = " non-interactive " >
146152<![CDATA[
147153<?php
148154declare(encoding='ISO-8859-1');
149155// code here
150- ?>
151156]]>
152157 </programlisting >
153158 </example >
0 commit comments