ReflectionClass_newInstanceArgs_002.phpt 486 B

1234567891011121314151617181920
  1. --TEST--
  2. ReflectionClass::newInstanceArgs() - wrong arg type
  3. --CREDITS--
  4. Robin Fernandes <robinf@php.net>
  5. Steve Seear <stevseea@php.net>
  6. --FILE--
  7. <?php
  8. class A {
  9. public function __construct($a, $b) {
  10. echo "In constructor of class B with arg $a\n";
  11. }
  12. }
  13. $rc = new ReflectionClass('A');
  14. $a = $rc->newInstanceArgs('x');
  15. var_dump($a);
  16. ?>
  17. --EXPECTF--
  18. Catchable fatal error: Argument 1 passed to ReflectionClass::newInstanceArgs() must be of the type array, string given in %s on line 8