Annotation of embedaddon/php/ext/reflection/tests/bug51911.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Bug #51911 (ReflectionParameter::getDefaultValue() memory leaks with constant array)
        !             3: --FILE--
        !             4: <?php
        !             5: 
        !             6: class Foo {
        !             7:    const X = 1;
        !             8:    public function x($x = array(1)) {}
        !             9: }
        !            10: 
        !            11: $clazz = new ReflectionClass('Foo');
        !            12: $method = $clazz->getMethod('x');
        !            13: foreach ($method->getParameters() as $param) {
        !            14:     if ( $param->isDefaultValueAvailable())
        !            15:         echo '$', $param->getName(), ' : ', var_export($param->getDefaultValue(), 1), "\n";
        !            16: }
        !            17: 
        !            18: ?>
        !            19: --EXPECT--
        !            20: $x : array (
        !            21:   0 => 1,
        !            22: )

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>