1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/Zend/tests/traits/constant_021.phpt

25 lines
525 B
PHP

--TEST--
Doc comments can be retrieved from trait constants
--FILE--
<?php
trait TestTrait {
/** DocComments */
public const Constant = 42;
}
class TestClass {
use TestTrait;
}
$reflection = new \ReflectionClass(TestTrait::class);
var_dump($reflection->getReflectionConstant('Constant')->getDocComment());
$reflection = new \ReflectionClass(TestClass::class);
var_dump($reflection->getReflectionConstant('Constant')->getDocComment());
?>
--EXPECTF--
string(18) "/** DocComments */"
string(18) "/** DocComments */"