Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get-debug-type.xml Make the example executable + tags #3755

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions reference/var/functions/get-debug-type.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Possible values for the returned string are:
Possible values for the returned &string; are:

<informaltable>
<tgroup cols="2">
Expand All @@ -63,7 +63,7 @@
<entry>-</entry>
</row>
<row>
<entry>Booleans (true or false)</entry>
<entry>Booleans (&true; or &false;)</entry>
<entry>
<literal>"bool"</literal>
</entry>
Expand Down Expand Up @@ -109,7 +109,7 @@
<entry>
<literal>"resource (closed)"</literal>
</entry>
<entry>Example: A file stream after being closed with fclose.</entry>
<entry>Example: A file stream after being closed with <function>fclose</function>.</entry>
</row>
<row>
<entry>Objects from Named Classes</entry>
Expand All @@ -121,10 +121,11 @@
<row>
<entry>Objects from Anonymous Classes</entry>
<entry>
<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>
<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>
</entry>
<entry>
Anonymous classes are those created through the $x = new class { ... } syntax
Anonymous classes are those created through the <code>$x = new class { ... }</code> syntax
</entry>
</row>
</tbody>
Expand All @@ -142,6 +143,9 @@
<programlisting role="php">
<![CDATA[
<?php

namespace Foo;

echo get_debug_type(null) . PHP_EOL;
echo get_debug_type(true) . PHP_EOL;
echo get_debug_type(1) . PHP_EOL;
Expand All @@ -155,15 +159,18 @@ echo get_debug_type($fp) . PHP_EOL;
fclose($fp);
echo get_debug_type($fp) . PHP_EOL;

echo get_debug_type(new stdClass) . PHP_EOL;
echo get_debug_type(new \stdClass) . PHP_EOL;
echo get_debug_type(new class {}) . PHP_EOL;

namespace Foo;
interface A {}
interface B {}
class C {}

echo get_debug_type(new class implements A {}), PHP_EOL;
echo get_debug_type(new class implements A,B {}), PHP_EOL;
echo get_debug_type(new class extends C {}), PHP_EOL;
echo get_debug_type(new class extends C implements A {}), PHP_EOL;

echo get_debug_type(new class implements A {}) . PHP_EOL;
echo get_debug_type(new class implements A,B {}) . PHP_EOL;
echo get_debug_type(new class extends C {}) . PHP_EOL;
echo get_debug_type(new class extends C implements A {}) . PHP_EOL;
?>
]]>
</programlisting>
Expand Down