1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 09:42:22 +01:00
Files
archived-php-src/ext/reflection/tests/bug71767.phpt
2018-10-14 19:45:12 +02:00

45 lines
825 B
PHP

--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";
?>
--EXPECT--
/** Correct docblock */
/** Correct docblock */
/** Correct docblock */
Done