1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 17:52:16 +01:00
Files
archived-php-src/ext/reflection/tests/bug71767.phpt
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00

45 lines
833 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