xref: /PHP-5.6/ext/reflection/tests/bug62715.phpt (revision 170ee90b)
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--EXPECT--
20bool(true)
21bool(true)
22bool(false)
23NULL
24int(0)
25