phpDocumentor / ReflectionDocBlock

MIT License
9.34k stars 117 forks source link

Referring a global variable with @see $varname in a docblock causes #335

Open oschildt opened 2 years ago

oschildt commented 2 years ago

Let's say I have the following PHP Code

/**
 * This is a global var.
 *
 * @see $varname
 */
$varname = "test";

/**
 * This is a class
 *
 * @see $varname
 */
class Base
{
}

When I try to parse it

$factory  = \phpDocumentor\Reflection\DocBlockFactory::createInstance();
$docblock = $factory->create($docComment);

Ir crashes the PHP engine in version 8.0.6 and 8.1.6.