1
0
mirror of https://github.com/php/php-src.git synced 2026-04-18 05:21:02 +02:00
Files
archived-php-src/ext/reflection/tests/bug64936.phpt
Fabien Villepinte a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00

34 lines
877 B
PHP

--TEST--
ReflectionMethod::getDocComment() uses left over doc comment from previous scanner run
--SKIPIF--
<?php if (!extension_loaded('tokenizer')) die('skip tokenizer extension not loaded'); ?>
--INI--
opcache.save_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()));
?>
--EXPECT--
bool(false)
bool(false)