summaryrefslogtreecommitdiff
path: root/ext/reflection/tests/bug51905.phpt
blob: 8969924e45f364d17f353d1def1aab46c6c3f09c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--TEST--
Bug #51905 (ReflectionParameter fails if default value is an array with an access to self::)
--FILE--
<?php

class Bar {
	const Y = 20;
}

class Foo extends Bar {
	const X = 12;
	public function x($x = 1, $y = array(self::X), $z = parent::Y) {}
}

$clazz = new ReflectionClass('Foo');
$method = $clazz->getMethod('x');
foreach ($method->getParameters() as $param) {
    if ( $param->isDefaultValueAvailable())
        echo '$', $param->getName(), ' : ', var_export($param->getDefaultValue(), 1), "\n";
}

?>
--EXPECT--
$x : 1
$y : array (
  0 => 12,
)
$z : 20