ReflectionObject_isSubclassOf_error.phpt 631 B

123456789101112131415161718192021222324
  1. --TEST--
  2. ReflectionObject::isSubclassOf() - invalid params
  3. --FILE--
  4. <?php
  5. class A {}
  6. $ro = new ReflectionObject(new A);
  7. var_dump($ro->isSubclassOf());
  8. var_dump($ro->isSubclassOf('A',5));
  9. var_dump($ro->isSubclassOf('X'));
  10. ?>
  11. --EXPECTF--
  12. Warning: ReflectionClass::isSubclassOf() expects exactly 1 parameter, 0 given in %s on line 5
  13. NULL
  14. Warning: ReflectionClass::isSubclassOf() expects exactly 1 parameter, 2 given in %s on line 6
  15. NULL
  16. Fatal error: Uncaught exception 'ReflectionException' with message 'Class X does not exist' in %s:7
  17. Stack trace:
  18. #0 %s(7): ReflectionClass->isSubclassOf('X')
  19. #1 {main}
  20. thrown in %s on line 7