ReflectionParameter_getDeclaringFunction_basic.phpt 817 B

12345678910111213141516171819202122232425262728293031323334
  1. --TEST--
  2. ReflectionParameter::getDeclaringFunction()
  3. --CREDITS--
  4. Stefan Koopmanschap <stefan@stefankoopmanschap.nl>
  5. #testfest roosendaal on 2008-05-10
  6. --FILE--
  7. <?php
  8. function ReflectionParameterTest($test, $test2 = null) {
  9. echo $test;
  10. }
  11. $reflect = new ReflectionFunction('ReflectionParameterTest');
  12. $params = $reflect->getParameters();
  13. foreach($params as $key => $value) {
  14. echo $value->getDeclaringFunction() . "\n";
  15. }
  16. ?>
  17. --EXPECTF--
  18. Function [ <user> function ReflectionParameterTest ] {
  19. @@ %s.php %d - %d
  20. - Parameters [2] {
  21. Parameter #0 [ <required> $test ]
  22. Parameter #1 [ <optional> $test2 = NULL ]
  23. }
  24. }
  25. Function [ <user> function ReflectionParameterTest ] {
  26. @@ %s.php %d - %d
  27. - Parameters [2] {
  28. Parameter #0 [ <required> $test ]
  29. Parameter #1 [ <optional> $test2 = NULL ]
  30. }
  31. }