xref: /PHP-7.4/ext/reflection/tests/bug33312.phpt (revision 610c7fbe)
1--TEST--
2Reflection Bug #33312 (ReflectionParameter methods do not work correctly)
3--FILE--
4<?php
5class Foo {
6    public function bar(Foo $foo, $bar = 'bar') {
7    }
8}
9
10$class = new ReflectionClass('Foo');
11$method = $class->getMethod('bar');
12
13foreach ($method->getParameters() as $parameter) {
14    if ($parameter->isDefaultValueAvailable()) {
15        print $parameter->getDefaultValue()."\n";
16    }
17}
18?>
19--EXPECT--
20bar
21