mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
fixed a typo
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@268280 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
f60082dcb0
commit
ec69be2db5
1 changed files with 13 additions and 13 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.38 $ -->
|
||||
<!-- $Revision: 1.39 $ -->
|
||||
<sect1 xml:id="language.oop5.reflection" xmlns="http://docbook.org/ns/docbook">
|
||||
<title>Reflection</title>
|
||||
<sect2 xml:id="language.oop5.reflection.toc">
|
||||
|
@ -23,7 +23,7 @@
|
|||
<para>
|
||||
PHP 5 comes with a complete reflection API that adds the ability to
|
||||
reverse-engineer classes, interfaces, functions and methods as well
|
||||
as extensions. Additionally, the reflection API also offers ways of
|
||||
as extensions. Additionally, the reflection API also offers ways of
|
||||
retrieving doc comments for functions, classes and methods.
|
||||
</para>
|
||||
<para>
|
||||
|
@ -222,7 +222,7 @@ class ReflectionFunction extends ReflectionFunctionAbstract implements Reflector
|
|||
*
|
||||
* @return int
|
||||
*/
|
||||
function counter()
|
||||
function counter()
|
||||
{
|
||||
static $c = 0;
|
||||
return $c++;
|
||||
|
@ -317,8 +317,8 @@ class ReflectionParameter implements Reflector
|
|||
</note>
|
||||
<para>
|
||||
To introspect function parameters, you will first have to create an instance
|
||||
of the <classname>ReflectionFunction</classname> or
|
||||
<classname>ReflectionMethod</classname> classes and then use their
|
||||
of the <classname>ReflectionFunction</classname> or
|
||||
<classname>ReflectionMethod</classname> classes and then use their
|
||||
<function>getParameters</function> method to retrieve an array of parameters.
|
||||
</para>
|
||||
<example>
|
||||
|
@ -332,7 +332,7 @@ function baz(ReflectionFunction $a, $b = 1, $c = null) { }
|
|||
function abc() { }
|
||||
|
||||
// Create an instance of ReflectionFunction with the
|
||||
// parameter given from the command line.
|
||||
// parameter given from the command line.
|
||||
$reflect = new ReflectionFunction($argv[1]);
|
||||
|
||||
echo $reflect;
|
||||
|
@ -447,7 +447,7 @@ class Object
|
|||
/**
|
||||
* A counter class
|
||||
*/
|
||||
class Counter extends Object implements Serializable
|
||||
class Counter extends Object implements Serializable
|
||||
{
|
||||
const START = 0;
|
||||
private static $c = Counter::START;
|
||||
|
@ -504,7 +504,7 @@ printf("---> Methods: %s\n", var_export($class->getMethods(), 1));
|
|||
if ($class->isInstantiable()) {
|
||||
$counter = $class->newInstance();
|
||||
|
||||
echo '---> $counter is instance? ';
|
||||
echo '---> $counter is instance? ';
|
||||
echo $class->isInstance($counter) ? 'yes' : 'no';
|
||||
|
||||
echo "\n---> new Object() is instance? ";
|
||||
|
@ -524,7 +524,7 @@ if ($class->isInstantiable()) {
|
|||
<note>
|
||||
<simpara>
|
||||
<literal>$class = new ReflectionClass('Foo'); $class->isInstance($arg)</literal>
|
||||
is equivalent to <literal>$arg instanceof Foo</literal> or
|
||||
is equivalent to <literal>$arg instanceof Foo</literal> or
|
||||
<literal>is_a($arg, 'Foo')</literal>.
|
||||
</simpara>
|
||||
</note>
|
||||
|
@ -680,7 +680,7 @@ class Example {
|
|||
echo "Hello World!\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$class = new ReflectionClass('Example');
|
||||
$method = $class->getMethod('printer');
|
||||
$closure = $method->getClosure(); /* As of PHP 5.3.0 */
|
||||
|
@ -700,7 +700,7 @@ $closure(); // Hello World!
|
|||
<note>
|
||||
<simpara>
|
||||
For static methods as seen above, you should pass NULL as the first
|
||||
argument to <function>invoke</function>. For non-static methods, pass
|
||||
argument to <function>invoke</function>. For non-static methods, pass
|
||||
an instance of the class.
|
||||
</simpara>
|
||||
</note>
|
||||
|
@ -867,7 +867,7 @@ class ReflectionExtension implements Reflector {
|
|||
<programlisting role='php'>
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Create an instance of the ReflectionProperty class
|
||||
// Create an instance of the ReflectionExtension class
|
||||
$ext = new ReflectionExtension('standard');
|
||||
|
||||
// Print out basic information
|
||||
|
@ -959,7 +959,7 @@ var_dump(new My_Reflection_Method('U', 'x'));
|
|||
</note>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
|
Loading…
Reference in a new issue