xref: /PHP-8.0/ext/reflection/tests/bug62715.phpt (revision 3b08f53c)
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: Required parameter $c follows optional parameter $b in %s on line %d
21bool(true)
22bool(true)
23bool(false)
24NULL
25int(0)
26