bug33312.phpt 419 B

1234567891011121314151617181920
  1. --TEST--
  2. Reflection Bug #33312 (ReflectionParameter methods do not work correctly)
  3. --FILE--
  4. <?php
  5. class Foo {
  6. public function bar(Foo $foo, $bar = 'bar') {
  7. }
  8. }
  9. $class = new ReflectionClass('Foo');
  10. $method = $class->getMethod('bar');
  11. foreach ($method->getParameters() as $parameter) {
  12. if ($parameter->isDefaultValueAvailable()) {
  13. print $parameter->getDefaultValue()."\n";
  14. }
  15. }
  16. ?>
  17. --EXPECT--
  18. bar