summaryrefslogtreecommitdiff
path: root/ext/reflection/tests/ReflectionMethod_invoke_error2.phpt
blob: a070c8f583131d6d23ddb75498febe3d50baad86 (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
--TEST--
ReflectionMethod::invoke() further errors
--FILE--
<?php

class TestClass {

    public function methodWithArgs($a, $b) {
        echo "Called methodWithArgs($a, $b)\n";
    }
}

$methodWithArgs = new ReflectionMethod('TestClass', 'methodWithArgs');

$testClassInstance = new TestClass();

echo "\nMethod with args:\n";
var_dump($methodWithArgs->invoke($testClassInstance));

?>
--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