1--TEST--
2ReflectionMethod methods - wrong num args
3--CREDITS--
4Robin Fernandes <robinf@php.net>
5Steve Seear <stevseea@php.net>
6--FILE--
7<?php
8
9try {
10	new ReflectionMethod();
11} catch (TypeError $re) {
12	echo "Ok - ".$re->getMessage().PHP_EOL;
13}
14try {
15	new ReflectionMethod('a', 'b', 'c');
16} catch (TypeError $re) {
17	echo "Ok - ".$re->getMessage().PHP_EOL;
18}
19
20class C {
21    public function f() {}
22}
23
24$rm = new ReflectionMethod('C', 'f');
25
26var_dump($rm->isFinal(1));
27var_dump($rm->isAbstract(1));
28var_dump($rm->isPrivate(1));
29var_dump($rm->isProtected(1));
30var_dump($rm->isPublic(1));
31var_dump($rm->isStatic(1));
32var_dump($rm->isConstructor(1));
33var_dump($rm->isDestructor(1));
34var_dump($rm->getModifiers(1));
35var_dump($rm->isInternal(1));
36var_dump($rm->isUserDefined(1));
37var_dump($rm->getFileName(1));
38var_dump($rm->getStartLine(1));
39var_dump($rm->getEndLine(1));
40var_dump($rm->getStaticVariables(1));
41var_dump($rm->getName(1));
42
43
44?>
45--EXPECTF--
46Ok - ReflectionMethod::__construct() expects exactly 1 parameter, 0 given
47Ok - ReflectionMethod::__construct() expects exactly 1 parameter, 3 given
48
49Warning: ReflectionMethod::isFinal() expects exactly 0 parameters, 1 given in %s on line %d
50NULL
51
52Warning: ReflectionMethod::isAbstract() expects exactly 0 parameters, 1 given in %s on line %d
53NULL
54
55Warning: ReflectionMethod::isPrivate() expects exactly 0 parameters, 1 given in %s on line %d
56NULL
57
58Warning: ReflectionMethod::isProtected() expects exactly 0 parameters, 1 given in %s on line %d
59NULL
60
61Warning: ReflectionMethod::isPublic() expects exactly 0 parameters, 1 given in %s on line %d
62NULL
63
64Warning: ReflectionMethod::isStatic() expects exactly 0 parameters, 1 given in %s on line %d
65NULL
66
67Warning: ReflectionMethod::isConstructor() expects exactly 0 parameters, 1 given in %s on line %d
68NULL
69
70Warning: ReflectionMethod::isDestructor() expects exactly 0 parameters, 1 given in %s on line %d
71NULL
72
73Warning: ReflectionMethod::getModifiers() expects exactly 0 parameters, 1 given in %s on line %d
74NULL
75
76Warning: ReflectionFunctionAbstract::isInternal() expects exactly 0 parameters, 1 given in %s on line %d
77NULL
78
79Warning: ReflectionFunctionAbstract::isUserDefined() expects exactly 0 parameters, 1 given in %s on line %d
80NULL
81
82Warning: ReflectionFunctionAbstract::getFileName() expects exactly 0 parameters, 1 given in %s on line %d
83NULL
84
85Warning: ReflectionFunctionAbstract::getStartLine() expects exactly 0 parameters, 1 given in %s on line %d
86NULL
87
88Warning: ReflectionFunctionAbstract::getEndLine() expects exactly 0 parameters, 1 given in %s on line %d
89NULL
90
91Warning: ReflectionFunctionAbstract::getStaticVariables() expects exactly 0 parameters, 1 given in %s on line %d
92NULL
93
94Warning: ReflectionFunctionAbstract::getName() expects exactly 0 parameters, 1 given in %s on line %d
95NULL
96