PHPParseTokenError
Less than 1 minute
PHPParseTokenError
Exception thrown when a specific PHP token cannot be parsed.
class PHPParseTokenError extends \Hazaar\Parser\Exception\PHPParserErrorThis exception provides details about the token type and the token itself, which may be a string or a Token object. It extends PHPParserError to provide additional context for token parsing failures.
Properties
tokenType
The type of the token that failed to parse.
private string $tokenTypetoken
public Token $tokenMethods
__construct
Constructs a new PHPParseTokenError.
public __construct(string $tokenType, Token $token, ?\Throwable $previous, int $code = 500): voidParameters
| Parameter | Type | Description |
|---|---|---|
$tokenType | string | the type of the token that failed to parse |
$token | Token | the token that caused the error |
$previous | \Throwable | optional previous exception for chaining |
$code | int | optional error code (default: 500) |
__toString
Returns a string representation of the parse token error.
public __toString(): stringIncludes details about the token type, the token itself, and any previous exception message.
Generated by Hazaar API Doc Generator on Tue, 21 Apr 2026 04:00:25 +0000