summaryrefslogtreecommitdiff
path: root/ext/reflection/tests/bug64936.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/reflection/tests/bug64936.phpt')
-rw-r--r--ext/reflection/tests/bug64936.phpt34
1 files changed, 34 insertions, 0 deletions
diff --git a/ext/reflection/tests/bug64936.phpt b/ext/reflection/tests/bug64936.phpt
new file mode 100644
index 0000000000..578dc7e4c0
--- /dev/null
+++ b/ext/reflection/tests/bug64936.phpt
@@ -0,0 +1,34 @@
+--TEST--
+ReflectionMethod::getDocComment() uses left over doc comment from previous scanner run
+--INI--
+opcache.save_comments=1
+opcache.load_comments=1
+--FILE--
+<?php
+
+function strip_doc_comment($c)
+{
+ if (!strlen($c) || $c === false) return $c;
+ return trim(substr($c, 3, -2));
+}
+
+token_get_all("<?php\n/**\n * Foo\n */"); // doc_comment compiler global now contains this Foo comment
+
+eval('class A { }'); // Could also be an include of a file containing similar
+
+$ra = new ReflectionClass('A');
+var_dump(strip_doc_comment($ra->getDocComment()));
+
+token_get_all("<?php\n/**\n * Foo\n */"); // doc_comment compiler global now contains this Foo comment
+
+include('bug64936.inc');
+
+$rb = new ReflectionClass('B');
+var_dump(strip_doc_comment($rb->getDocComment()));
+
+?>
+===DONE===
+--EXPECT--
+bool(false)
+bool(false)
+===DONE===