xref: /PHP-8.2/Zend/tests/traits/constant_021.phpt (revision 3b62d660)
1--TEST--
2Doc comments can be retrieved from trait constants
3--FILE--
4<?php
5
6trait TestTrait {
7  /** DocComments */
8  public const Constant = 42;
9}
10
11class TestClass {
12  use TestTrait;
13}
14
15$reflection = new \ReflectionClass(TestTrait::class);
16var_dump($reflection->getReflectionConstant('Constant')->getDocComment());
17
18$reflection = new \ReflectionClass(TestClass::class);
19var_dump($reflection->getReflectionConstant('Constant')->getDocComment());
20
21?>
22--EXPECTF--
23string(18) "/** DocComments */"
24string(18) "/** DocComments */"
25