summaryrefslogtreecommitdiff
path: root/ext/reflection/tests/bug51911.phpt
blob: 12eb459fbc2d09130153c31973c7bbc14859c7b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--TEST--
Bug #51911 (ReflectionParameter::getDefaultValue() memory leaks with constant array)
--FILE--
<?php

class Foo {
   const X = 1;
   public function x($x = array(1)) {}
}

$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 : array (
  0 => 1,
)