3v4l.org

run code in 300+ PHP versions simultaneously
<?php class X { /** * @annotation1 */ // Some comment public $x = "x", $y = 'y', /** @annotation2 */ $z = 'z' ; } $reflection = new ReflectionProperty('\X', 'x'); var_dump($reflection->getDocComment()); $reflection = new ReflectionProperty('\X', 'y'); var_dump($reflection->getDocComment());

preferences:
48.27 ms | 402 KiB | 5 Q