diff options
author | Grigorii Sokolik <g.sokolik@delivery-club.ru> | 2016-03-11 19:28:45 +0300 |
---|---|---|
committer | Nikita Popov <nikic@php.net> | 2016-03-11 22:27:48 +0100 |
commit | ccc5150f15c747fe5e9b5a17fcb135e7989d0181 (patch) | |
tree | ce485f8cdf24fae1eb2898d866ab298e96b71baa /ext/reflection | |
parent | fca831e8ad05c344226566fbb9051230421d6578 (diff) | |
download | php-git-ccc5150f15c747fe5e9b5a17fcb135e7989d0181.tar.gz |
Fix bug #71767
Diffstat (limited to 'ext/reflection')
-rw-r--r-- | ext/reflection/tests/bug71767.phpt | 44 |
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 |