summaryrefslogtreecommitdiff
path: root/ext/reflection/tests/bug71767.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/reflection/tests/bug71767.phpt')
-rw-r--r--ext/reflection/tests/bug71767.phpt44
1 files changed, 44 insertions, 0 deletions
diff --git a/ext/reflection/tests/bug71767.phpt b/ext/reflection/tests/bug71767.phpt
new file mode 100644
index 0000000000..8c4059abf4
--- /dev/null
+++ b/ext/reflection/tests/bug71767.phpt
@@ -0,0 +1,44 @@
+--TEST--
+Bug #71767 (ReflectionMethod::getDocComment returns the wrong comment)
+--FILE--
+<?php
+
+/** Correct docblock */
+function foo(
+ /** wrong docblock */
+ $arg
+) {
+}
+
+class Foo {
+ /** Correct docblock */
+ public function bar(
+ /** wrong docblock */
+ $arg
+ ) {
+
+ }
+}
+
+/** Correct docblock */
+$func = function(
+ /** wrong docblock */
+ $arg
+) {
+};
+
+$reflectionFunction = new ReflectionFunction('foo');
+$reflectionClass = new ReflectionClass(Foo::class);
+$reflectionClosure = new ReflectionFunction($func);
+
+echo $reflectionFunction->getDocComment() . PHP_EOL;
+echo $reflectionClass->getMethod('bar')->getDocComment() . PHP_EOL;
+echo $reflectionClosure->getDocComment() . PHP_EOL;
+
+echo "Done\n";
+?>
+--EXPECTF--
+/** Correct docblock */
+/** Correct docblock */
+/** Correct docblock */
+Done