mirror of
https://github.com/php/php-src.git
synced 2024-10-20 07:53:58 +00:00
33 lines
701 B
PHP
33 lines
701 B
PHP
--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
|