ReflectionObject_isInstance_error.phpt 1.1 KB

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