xref: /PHP-7.0/tests/strings/004.phpt (revision 9a38f301)
1--TEST--
2highlight_string() buffering
3--INI--
4highlight.string=#DD0000
5highlight.comment=#FF9900
6highlight.keyword=#007700
7highlight.default=#0000BB
8highlight.html=#000000
9--FILE--
10<?php
11$var = highlight_string("<br /><?php echo \"foo\"; ?><br />");
12$var = highlight_string("<br /><?php echo \"bar\"; ?><br />", TRUE);
13echo "\n[$var]\n";
14?>
15--EXPECT--
16<code><span style="color: #000000">
17&lt;br&nbsp;/&gt;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">"foo"</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">?&gt;</span>&lt;br&nbsp;/&gt;</span>
18</code>
19[<code><span style="color: #000000">
20&lt;br&nbsp;/&gt;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">"bar"</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">?&gt;</span>&lt;br&nbsp;/&gt;</span>
21</code>]
22