blob: ac97e3ed2a4470500957880a58955e02d3d80250 (
plain)
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
|
--TEST--
ReflectionMethod:invokeArgs() errors
--FILE--
<?php
class TestClass {
public function methodWithArgs($a, $b) {
echo "Called methodWithArgs($a, $b)\n";
}
}
abstract class AbstractClass {
abstract function foo();
}
$methodWithArgs = new ReflectionMethod('TestClass', 'methodWithArgs');
$testClassInstance = new TestClass();
echo "\nMethod with args:\n";
var_dump($methodWithArgs->invokeArgs($testClassInstance, array()));
?>
--EXPECTF--
Method with args:
Warning: Missing argument 1 for TestClass::methodWithArgs() in %s on line %d
Warning: Missing argument 2 for TestClass::methodWithArgs() in %s on line %d
Notice: Undefined variable: a in %s on line %d
Notice: Undefined variable: b in %s on line %d
Called methodWithArgs(, )
NULL
|