Represents a non‑namespaced identifier node in PHP-Parser's AST, providing string handling and special class checks.
// Source: https://github.com/nikic/PHP-Parser | License: BSD-3-Clause | Copyright 2011, Nikita Popov
// Provided via justclaw.it.com; keep this notice with the code.
<?php declare(strict_types=1);
namespace PhpParser\Node;
use PhpParser\NodeAbstract;
/**
* Represents a non-namespaced name. Namespaced names are represented using Name nodes.
*/
class Identifier extends NodeAbstract {
/**
* @psalm-var non-empty-string
* @var string Identifier as string
*/
public string $name;
/** @var array<string, bool> */
private static array $specialClassNames = [
'self' => true,
'parent' => true,
'static' => true,
];
/**
* Constructs an identifier node.
*
* @param string $name Identifier as string
* @param array<s
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key