1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
|
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 290998 $ -->
<chapter xml:id="reflection.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.examples;
<para>
Many examples exist within the Reflection documentation, typically
within the __construct documentation for each class.
</para>
<example>
<title>Reflection Example from Shell (a Terminal)</title>
<programlisting role="shell">
<![CDATA[
$ php --rf strlen
$ php --rc finfo
$ php --re json
$ php --ri dom
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
Function [ <internal:Core> function strlen ] {
- Parameters [1] {
Parameter #0 [ <required> $str ]
}
}
Class [ <internal:fileinfo> class finfo ] {
- Constants [0] {
}
- Static properties [0] {
}
- Static methods [0] {
}
- Properties [0] {
}
- Methods [4] {
Method [ <internal:fileinfo, ctor> public method finfo ] {
- Parameters [2] {
Parameter #0 [ <optional> $options ]
Parameter #1 [ <optional> $arg ]
}
}
Method [ <internal:fileinfo> public method set_flags ] {
- Parameters [1] {
Parameter #0 [ <required> $options ]
}
}
Method [ <internal:fileinfo> public method file ] {
- Parameters [3] {
Parameter #0 [ <required> $filename ]
Parameter #1 [ <optional> $options ]
Parameter #2 [ <optional> $context ]
}
}
Method [ <internal:fileinfo> public method buffer ] {
- Parameters [3] {
Parameter #0 [ <required> $string ]
Parameter #1 [ <optional> $options ]
Parameter #2 [ <optional> $context ]
}
}
}
}
Extension [ <persistent> extension #23 json version 1.2.1 ] {
- Constants [10] {
Constant [ integer JSON_HEX_TAG ] { 1 }
Constant [ integer JSON_HEX_AMP ] { 2 }
Constant [ integer JSON_HEX_APOS ] { 4 }
Constant [ integer JSON_HEX_QUOT ] { 8 }
Constant [ integer JSON_FORCE_OBJECT ] { 16 }
Constant [ integer JSON_ERROR_NONE ] { 0 }
Constant [ integer JSON_ERROR_DEPTH ] { 1 }
Constant [ integer JSON_ERROR_STATE_MISMATCH ] { 2 }
Constant [ integer JSON_ERROR_CTRL_CHAR ] { 3 }
Constant [ integer JSON_ERROR_SYNTAX ] { 4 }
}
- Functions {
Function [ <internal:json> function json_encode ] {
- Parameters [2] {
Parameter #0 [ <required> $value ]
Parameter #1 [ <optional> $options ]
}
}
Function [ <internal:json> function json_decode ] {
- Parameters [3] {
Parameter #0 [ <required> $json ]
Parameter #1 [ <optional> $assoc ]
Parameter #2 [ <optional> $depth ]
}
}
Function [ <internal:json> function json_last_error ] {
- Parameters [0] {
}
}
}
}
dom
DOM/XML => enabled
DOM/XML API Version => 20031129
libxml Version => 2.7.3
HTML Support => enabled
XPath Support => enabled
XPointer Support => enabled
Schema Support => enabled
RelaxNG Support => enabled
]]>
</screen>
</example>
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
|