You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
768 B

  1. --TEST--
  2. ReflectionMethod::invoke() further errors
  3. --SKIPIF--
  4. <?php extension_loaded('reflection') or die('skip'); ?>
  5. --FILE--
  6. <?php
  7. class TestClass {
  8. public function methodWithArgs($a, $b) {
  9. echo "Called methodWithArgs($a, $b)\n";
  10. }
  11. }
  12. $methodWithArgs = new ReflectionMethod('TestClass', 'methodWithArgs');
  13. $testClassInstance = new TestClass();
  14. echo "\nMethod with args:\n";
  15. var_dump($methodWithArgs->invoke($testClassInstance));
  16. ?>
  17. --EXPECTF--
  18. Method with args:
  19. Warning: Missing argument 1 for TestClass::methodWithArgs() in %s on line %d
  20. Warning: Missing argument 2 for TestClass::methodWithArgs() in %s on line %d
  21. Notice: Undefined variable: a in %s on line %d
  22. Notice: Undefined variable: b in %s on line %d
  23. Called methodWithArgs(, )
  24. NULL