From 1c1b29f597bd56dcd072736f5ca601a4b6f54a72 Mon Sep 17 00:00:00 2001 From: Christoph Michael Becker Date: Sat, 30 Jun 2018 12:42:20 +0000 Subject: [PATCH] Fix #65011: ReflectionProperty::getDocComment() fails for multiple variable declarations We add an example to clarify the behavior. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@345251 c90b9560-bf6c-de11-be94-00142212c4b1 --- .../reflectionproperty/getdoccomment.xml | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/reference/reflection/reflectionproperty/getdoccomment.xml b/reference/reflection/reflectionproperty/getdoccomment.xml index f826bde565..cfea70d153 100644 --- a/reference/reflection/reflectionproperty/getdoccomment.xml +++ b/reference/reflection/reflectionproperty/getdoccomment.xml @@ -59,6 +59,38 @@ var_dump($prop->getDocComment()); string(53) "/** * @var int The length of the string */" +]]> + + + + + + + Multiple property declarations + + If multiple property declarations are preceeded by a single doc comment, + the doc comment refers to the first property only. + + +getProperties() as $property) { + echo $property->getName() . ': ' . var_export($property->getDocComment(), true) . PHP_EOL; +} +?> +]]> + + &example.outputs; + +