ReflectionClass_isInstance_error.phpt 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. --TEST--
  2. ReflectionClass::isInstance() - invalid params
  3. --FILE--
  4. <?php
  5. class X {}
  6. $rc = new ReflectionClass("X");
  7. $instance = new X;
  8. var_dump($rc->isInstance());
  9. var_dump($rc->isInstance($instance, $instance));
  10. var_dump($rc->isInstance(1));
  11. var_dump($rc->isInstance(1.5));
  12. var_dump($rc->isInstance(true));
  13. var_dump($rc->isInstance('X'));
  14. var_dump($rc->isInstance(null));
  15. ?>
  16. --EXPECTF--
  17. Warning: ReflectionClass::isInstance() expects exactly 1 parameter, 0 given in %s on line 7
  18. NULL
  19. Warning: ReflectionClass::isInstance() expects exactly 1 parameter, 2 given in %s on line 8
  20. NULL
  21. Warning: ReflectionClass::isInstance() expects parameter 1 to be object, %s given in %s on line 9
  22. NULL
  23. Warning: ReflectionClass::isInstance() expects parameter 1 to be object, double given in %s on line 10
  24. NULL
  25. Warning: ReflectionClass::isInstance() expects parameter 1 to be object, boolean given in %s on line 11
  26. NULL
  27. Warning: ReflectionClass::isInstance() expects parameter 1 to be object, string given in %s on line 12
  28. NULL
  29. Warning: ReflectionClass::isInstance() expects parameter 1 to be object, null given in %s on line 13
  30. NULL