summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2010-05-26 00:00:58 (GMT)
committerFelipe Pena <felipe@php.net>2010-05-26 00:00:58 (GMT)
commit79d2aaf0f1775f89a775b2d2d793dff8bb0e7755 (patch)
tree4fb7db3456c0369c1e000a22167d285056ebab99 /ext
parent433cb868d65545f021a63d994febae21a1abe8aa (diff)
downloadphp-79d2aaf0f1775f89a775b2d2d793dff8bb0e7755.tar.gz
- Fixed bug #51905 (ReflectionParameter fails if default value is an array with an access to self::)
Diffstat (limited to 'ext')
-rw-r--r--ext/reflection/tests/bug51905.phpt28
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 0000000..8969924
--- /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