From ec69be2db5c4605cc079d1fefbcab55141757345 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nilg=C3=BCn=20Belma=20Bug=C3=BCner?= Date: Tue, 4 Nov 2008 15:49:10 +0000 Subject: [PATCH] fixed a typo git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@268280 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/oop5/reflection.xml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/language/oop5/reflection.xml b/language/oop5/reflection.xml index 3ae9adc33e..ec9eaa209e 100644 --- a/language/oop5/reflection.xml +++ b/language/oop5/reflection.xml @@ -1,5 +1,5 @@ - + Reflection @@ -23,7 +23,7 @@ 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. @@ -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 To introspect function parameters, you will first have to create an instance - of the ReflectionFunction or - ReflectionMethod classes and then use their + of the ReflectionFunction or + ReflectionMethod classes and then use their getParameters method to retrieve an array of parameters. @@ -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()) { $class = new ReflectionClass('Foo'); $class->isInstance($arg) - is equivalent to $arg instanceof Foo or + is equivalent to $arg instanceof Foo or is_a($arg, 'Foo'). @@ -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! For static methods as seen above, you should pass NULL as the first - argument to invoke. For non-static methods, pass + argument to invoke. For non-static methods, pass an instance of the class. @@ -867,7 +867,7 @@ class ReflectionExtension implements Reflector { - +