xref: /PHP-5.6/ext/reflection/tests/bug64936.phpt (revision 9be591bd)
1--TEST--
2ReflectionMethod::getDocComment() uses left over doc comment from previous scanner run
3--INI--
4opcache.save_comments=1
5opcache.load_comments=1
6--SKIPIF--
7<?php
8if (!extension_loaded('reflection') || !extension_loaded('tokenizer')) print 'skip missing reflection of tokernizer extension';
9?>
10--FILE--
11<?php
12
13function strip_doc_comment($c)
14{
15	if (!strlen($c) || $c === false) return $c;
16	return trim(substr($c, 3, -2));
17}
18
19token_get_all("<?php\n/**\n * Foo\n */"); // doc_comment compiler global now contains this Foo comment
20
21eval('class A { }'); // Could also be an include of a file containing similar
22
23$ra = new ReflectionClass('A');
24var_dump(strip_doc_comment($ra->getDocComment()));
25
26token_get_all("<?php\n/**\n * Foo\n */"); // doc_comment compiler global now contains this Foo comment
27
28include('bug64936.inc');
29
30$rb = new ReflectionClass('B');
31var_dump(strip_doc_comment($rb->getDocComment()));
32
33?>
34===DONE===
35--EXPECT--
36bool(false)
37bool(false)
38===DONE===
39