Skip to content

Commit 46e3bce

Browse files
authored
get_debug_type(): Make the example executable and semantic tags (#3755)
1 parent 26a5eff commit 46e3bce

File tree

1 file changed

+25
-19
lines changed

1 file changed

+25
-19
lines changed

reference/var/functions/get-debug-type.xml

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<refsect1 role="returnvalues">
4444
&reftitle.returnvalues;
4545
<para>
46-
Possible values for the returned string are:
46+
Possible values for the returned &string; are:
4747

4848
<informaltable>
4949
<tgroup cols="2">
@@ -63,7 +63,7 @@
6363
<entry>-</entry>
6464
</row>
6565
<row>
66-
<entry>Booleans (true or false)</entry>
66+
<entry>Booleans (&true; or &false;)</entry>
6767
<entry>
6868
<literal>"bool"</literal>
6969
</entry>
@@ -109,7 +109,7 @@
109109
<entry>
110110
<literal>"resource (closed)"</literal>
111111
</entry>
112-
<entry>Example: A file stream after being closed with fclose.</entry>
112+
<entry>Example: A file stream after being closed with <function>fclose</function>.</entry>
113113
</row>
114114
<row>
115115
<entry>Objects from Named Classes</entry>
@@ -124,7 +124,7 @@
124124
<literal>"class@anonymous"</literal> or parent class name/interface name if the class extends another class or implements an interface e.g. <literal>"Foo\Bar@anonymous"</literal>
125125
</entry>
126126
<entry>
127-
Anonymous classes are those created through the $x = new class { ... } syntax
127+
Anonymous classes are those created through the <code>$x = new class { ... }</code> syntax
128128
</entry>
129129
</row>
130130
</tbody>
@@ -142,28 +142,34 @@
142142
<programlisting role="php">
143143
<![CDATA[
144144
<?php
145-
echo get_debug_type(null) . PHP_EOL;
146-
echo get_debug_type(true) . PHP_EOL;
147-
echo get_debug_type(1) . PHP_EOL;
148-
echo get_debug_type(0.1) . PHP_EOL;
149-
echo get_debug_type("foo") . PHP_EOL;
150-
echo get_debug_type([]) . PHP_EOL;
145+
146+
namespace Foo;
147+
148+
echo get_debug_type(null), PHP_EOL;
149+
echo get_debug_type(true), PHP_EOL;
150+
echo get_debug_type(1), PHP_EOL;
151+
echo get_debug_type(0.1), PHP_EOL;
152+
echo get_debug_type("foo"), PHP_EOL;
153+
echo get_debug_type([]), PHP_EOL;
151154
152155
$fp = fopen(__FILE__, 'rb');
153-
echo get_debug_type($fp) . PHP_EOL;
156+
echo get_debug_type($fp), PHP_EOL;
154157
155158
fclose($fp);
156-
echo get_debug_type($fp) . PHP_EOL;
159+
echo get_debug_type($fp), PHP_EOL;
157160
158-
echo get_debug_type(new stdClass) . PHP_EOL;
159-
echo get_debug_type(new class {}) . PHP_EOL;
161+
echo get_debug_type(new \stdClass), PHP_EOL;
162+
echo get_debug_type(new class {}), PHP_EOL;
160163
161-
namespace Foo;
164+
interface A {}
165+
interface B {}
166+
class C {}
167+
168+
echo get_debug_type(new class implements A {}), PHP_EOL;
169+
echo get_debug_type(new class implements A,B {}), PHP_EOL;
170+
echo get_debug_type(new class extends C {}), PHP_EOL;
171+
echo get_debug_type(new class extends C implements A {}), PHP_EOL;
162172
163-
echo get_debug_type(new class implements A {}) . PHP_EOL;
164-
echo get_debug_type(new class implements A,B {}) . PHP_EOL;
165-
echo get_debug_type(new class extends C {}) . PHP_EOL;
166-
echo get_debug_type(new class extends C implements A {}) . PHP_EOL;
167173
?>
168174
]]>
169175
</programlisting>

0 commit comments

Comments
 (0)