mirror of
https://github.com/php/php-src.git
synced 2024-10-02 23:36:16 +00:00
23 lines
476 B
Plaintext
23 lines
476 B
Plaintext
|
--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,
|
||
|
)
|