Annotation of embedaddon/php/ext/reflection/tests/bug51905.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #51905 (ReflectionParameter fails if default value is an array with an access to self::)
! 3: --FILE--
! 4: <?php
! 5:
! 6: class Bar {
! 7: const Y = 20;
! 8: }
! 9:
! 10: class Foo extends Bar {
! 11: const X = 12;
! 12: public function x($x = 1, $y = array(self::X), $z = parent::Y) {}
! 13: }
! 14:
! 15: $clazz = new ReflectionClass('Foo');
! 16: $method = $clazz->getMethod('x');
! 17: foreach ($method->getParameters() as $param) {
! 18: if ( $param->isDefaultValueAvailable())
! 19: echo '$', $param->getName(), ' : ', var_export($param->getDefaultValue(), 1), "\n";
! 20: }
! 21:
! 22: ?>
! 23: --EXPECT--
! 24: $x : 1
! 25: $y : array (
! 26: 0 => 12,
! 27: )
! 28: $z : 20
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>