ReflectionClass_FileInfo_basic.phpt 814 B

123456789101112131415161718192021222324252627282930313233
  1. --TEST--
  2. ReflectionClass::getFileName(), ReflectionClass::getStartLine(), ReflectionClass::getEndLine()
  3. --FILE--
  4. <?php
  5. //New instance of class C - defined below
  6. $rc = new ReflectionClass("C");
  7. //Get the file name of the PHP script in which C is defined
  8. var_dump($rc->getFileName());
  9. //Get the line number at the start of the definition of class C
  10. var_dump($rc->getStartLine());
  11. //Get the line number at the end of the definition of class C
  12. var_dump($rc->getEndLine());
  13. //Same tests as above but stdclass is internal - so all results should be false.
  14. $rc = new ReflectionClass("stdClass");
  15. var_dump($rc->getFileName());
  16. var_dump($rc->getStartLine());
  17. var_dump($rc->getEndLine());
  18. Class C {
  19. }
  20. ?>
  21. --EXPECTF--
  22. string(%d) "%sReflectionClass_FileInfo_basic.php"
  23. int(20)
  24. int(22)
  25. bool(false)
  26. bool(false)
  27. bool(false)