xref: /php-src/ext/reflection/tests/bug62715.phpt (revision 2079da01)
1--TEST--
2Bug #62715 (ReflectionParameter::isDefaultValueAvailable() wrong result)
3--FILE--
4<?php
5
6function test(?PDO $a = null, $b = 0, array $c) {}
7$r = new ReflectionFunction('test');
8
9foreach ($r->getParameters() as $p) {
10    var_dump($p->isDefaultValueAvailable());
11}
12
13foreach ($r->getParameters() as $p) {
14    if ($p->isDefaultValueAvailable()) {
15        var_dump($p->getDefaultValue());
16    }
17}
18?>
19--EXPECTF--
20Deprecated: test(): Optional parameter $a declared before required parameter $c is implicitly treated as a required parameter in %s on line %d
21
22Deprecated: test(): Optional parameter $b declared before required parameter $c is implicitly treated as a required parameter in %s on line %d
23bool(false)
24bool(false)
25bool(false)
26