ReflectionClass_hasConstant_basic.phpt 410 B

1234567891011121314151617181920212223
  1. --TEST--
  2. ReflectionClass::hasConstant()
  3. --CREDITS--
  4. Marc Veldman <marc@ibuildings.nl>
  5. #testfest roosendaal on 2008-05-10
  6. --FILE--
  7. <?php
  8. //New instance of class C - defined below
  9. $rc = new ReflectionClass("C");
  10. //Check if C has constant foo
  11. var_dump($rc->hasConstant('foo'));
  12. //C should not have constant bar
  13. var_dump($rc->hasConstant('bar'));
  14. Class C {
  15. const foo=1;
  16. }
  17. ?>
  18. --EXPECT--
  19. bool(true)
  20. bool(false)