reference/misc/functions/highlight-string.xml
ba50f222e7108287fb6eb11265c2b28efe0cc0ce
ba50f222e7108287fb6eb11265c2b28efe0cc0ce
...
...
@@ -9,9 +9,9 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>mixed</type><methodname>highlight_string</methodname>
13
-
<methodparam><type>string</type><parameter>str</parameter></methodparam>
14
-
<methodparam choice="opt"><type>bool</type><parameter>return</parameter><initializer>false</initializer></methodparam>
12
+
<type class="union"><type>string</type><type>true</type></type><methodname>highlight_string</methodname>
13
+
<methodparam><type>string</type><parameter>string</parameter></methodparam>
14
+
<methodparam choice="opt"><type>bool</type><parameter>return</parameter><initializer>&false;</initializer></methodparam>
15
15
</methodsynopsis>
16
16
<simpara>
17
17
Outputs or returns html markup for a syntax highlighted version of the given PHP code
...
...
@@ -24,7 +24,7 @@
24
24
<para>
25
25
<variablelist>
26
26
<varlistentry>
27
-
<term><parameter>str</parameter></term>
27
+
<term><parameter>string</parameter></term>
28
28
<listitem>
29
29
<para>
30
30
The PHP code to be highlighted. This should include the opening tag.
...
...
@@ -48,8 +48,8 @@
48
48
&reftitle.returnvalues;
49
49
<para>
50
50
If <parameter>return</parameter> is set to &true;, returns the highlighted
51
-
code as a string instead of printing it out. Otherwise, it will return
52
-
&true; on success, &false; on failure.
51
+
code as a string instead of printing it out.
52
+
Otherwise, it will return &true;.
53
53
</para>
54
54
</refsect1>
55
55
...
...
@@ -66,9 +66,15 @@
66
66
</thead>
67
67
<tbody>
68
68
<row>
69
-
<entry>4.2.0</entry>
69
+
<entry>8.4.0</entry>
70
70
<entry>
71
-
The <parameter>return</parameter> parameter was added.
71
+
Return type changed from <type class="union"><type>string</type><type>bool</type></type> to <type class="union"><type>string</type><type>true</type></type>.
72
+
</entry>
73
+
</row>
74
+
<row>
75
+
<entry>8.3.0</entry>
76
+
<entry>
77
+
The resulting HTML has changed.
72
78
</entry>
73
79
</row>
74
80
</tbody>
...
...
@@ -89,26 +95,19 @@ highlight_string('<?php phpinfo(); ?>');
89
95
?>
90
96
]]>
91
97
</programlisting>
92
-
<para>
93
-
The above example will output (in PHP 4):
94
-
</para>
98
+
&example.outputs;
95
99
<screen>
96
100
<![CDATA[
97
-
<code><font color="#000000">
98
-
<font color="#0000BB"><?php phpinfo</font><font color="#007700">(); </font><font color="#0000BB">?></font>
99
-
</font>
101
+
<code><span style="color: #000000">
102
+
<span style="color: #0000BB"><?php phpinfo</span><span style="color: #007700">(); </span><span style="color: #0000BB">?></span>
103
+
</span>
100
104
</code>
101
105
]]>
102
106
</screen>
103
-
<para>
104
-
The above example will output (in PHP 5):
105
-
</para>
107
+
&example.outputs.83;
106
108
<screen>
107
109
<![CDATA[
108
-
<code><span style="color: #000000">
109
-
<span style="color: #0000BB"><?php phpinfo</span><span style="color: #007700">(); </span><span style="color: #0000BB">?></span>
110
-
</span>
111
-
</code>
110
+
<pre><code style="color: #000000"><span style="color: #0000BB"><?php phpinfo</span><span style="color: #007700">(); </span><span style="color: #0000BB">?></span></code></pre>
112
111
]]>
113
112
</screen>
114
113
</example>
115
114