diff options
Diffstat (limited to 'ext/reflection/tests/bug51905.phpt')
-rw-r--r-- | ext/reflection/tests/bug51905.phpt | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ext/reflection/tests/bug51905.phpt b/ext/reflection/tests/bug51905.phpt new file mode 100644 index 000000000..8969924e4 --- /dev/null +++ b/ext/reflection/tests/bug51905.phpt @@ -0,0 +1,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 |