PHPParseTokenError
Less than 1 minute
PHPParseTokenError
Exception thrown when a specific PHP token cannot be parsed.
class PHPParseTokenError extends \Hazaar\Parser\Exception\PHPParserErrorExtends: Hazaar\Parser\Exception\PHPParserError
This 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 $tokenTypeType: string
token
The token that caused the parse error. Can be a string or a Token object.
private string|Token $tokenType: string|Hazaar\Parser\PHP\Token
Methods
__construct
Constructs a new PHPParseTokenError.
public __construct(string $tokenType, string|Token $token, ?\Throwable $previous, int $code = 500): voidParameters
| Parameter | Type | Description |
|---|---|---|
$tokenType | string | the type of the token that failed to parse |
$token | string | Hazaar\Parser\PHP\Token |
$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(): stringReturns: string
Includes details about the token type, the token itself, and any previous exception message.
Generated by Hazaar API Doc Generator on Fri, 04 Sep 2026 23:32:16 +0000