Annotation of embedaddon/php/ext/reflection/tests/ReflectionFunction_001.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: ReflectionFunction methods
3: --CREDITS--
4: Robin Fernandes <robinf@php.net>
5: Steve Seear <stevseea@php.net>
6: --FILE--
7: <?php
8:
9: /**
10: * my doc comment
11: */
12: function foo () {
13: static $c;
14: static $a = 1;
15: static $b = "hello";
16: $d = 5;
17: }
18:
19: /***
20: * not a doc comment
21: */
22: function bar () {}
23:
24:
25: function dumpFuncInfo($name) {
26: $funcInfo = new ReflectionFunction($name);
27: var_dump($funcInfo->getName());
28: var_dump($funcInfo->isInternal());
29: var_dump($funcInfo->isUserDefined());
30: var_dump($funcInfo->getStartLine());
31: var_dump($funcInfo->getEndLine());
32: var_dump($funcInfo->getStaticVariables());
33: }
34:
35: dumpFuncInfo('foo');
36: dumpFuncInfo('bar');
37: dumpFuncInfo('extract');
38:
39: ?>
40: --EXPECT--
41: string(3) "foo"
42: bool(false)
43: bool(true)
44: int(6)
45: int(11)
46: array(3) {
47: ["c"]=>
48: NULL
49: ["a"]=>
50: int(1)
51: ["b"]=>
52: string(5) "hello"
53: }
54: string(3) "bar"
55: bool(false)
56: bool(true)
57: int(16)
58: int(16)
59: array(0) {
60: }
61: string(7) "extract"
62: bool(true)
63: bool(false)
64: bool(false)
65: bool(false)
66: array(0) {
67: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>