ReflectionProperty_error.phpt 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. --TEST--
  2. Test ReflectionProperty class errors.
  3. --FILE--
  4. <?php
  5. class C {
  6. public static $p;
  7. }
  8. var_dump(new ReflectionProperty());
  9. var_dump(new ReflectionProperty('C::p'));
  10. var_dump(new ReflectionProperty('C', 'p', 'x'));
  11. $rp = new ReflectionProperty('C', 'p');
  12. var_dump($rp->getName(1));
  13. var_dump($rp->isPrivate(1));
  14. var_dump($rp->isProtected(1));
  15. var_dump($rp->isPublic(1));
  16. var_dump($rp->isStatic(1));
  17. var_dump($rp->getModifiers(1));
  18. var_dump($rp->isDefault(1));
  19. ?>
  20. --EXPECTF--
  21. Warning: ReflectionProperty::__construct() expects exactly 2 parameters, 0 given in %s on line %d
  22. object(ReflectionProperty)#%d (2) {
  23. ["name"]=>
  24. string(0) ""
  25. ["class"]=>
  26. string(0) ""
  27. }
  28. Warning: ReflectionProperty::__construct() expects exactly 2 parameters, 1 given in %s on line %d
  29. object(ReflectionProperty)#%d (2) {
  30. ["name"]=>
  31. string(0) ""
  32. ["class"]=>
  33. string(0) ""
  34. }
  35. Warning: ReflectionProperty::__construct() expects exactly 2 parameters, 3 given in %s on line %d
  36. object(ReflectionProperty)#%d (2) {
  37. ["name"]=>
  38. string(0) ""
  39. ["class"]=>
  40. string(0) ""
  41. }
  42. Warning: ReflectionProperty::getName() expects exactly 0 parameters, 1 given in %s on line %d
  43. NULL
  44. Warning: ReflectionProperty::isPrivate() expects exactly 0 parameters, 1 given in %s on line %d
  45. NULL
  46. Warning: ReflectionProperty::isProtected() expects exactly 0 parameters, 1 given in %s on line %d
  47. NULL
  48. Warning: ReflectionProperty::isPublic() expects exactly 0 parameters, 1 given in %s on line %d
  49. NULL
  50. Warning: ReflectionProperty::isStatic() expects exactly 0 parameters, 1 given in %s on line %d
  51. NULL
  52. Warning: ReflectionProperty::getModifiers() expects exactly 0 parameters, 1 given in %s on line %d
  53. NULL
  54. Warning: ReflectionProperty::isDefault() expects exactly 0 parameters, 1 given in %s on line %d
  55. NULL