PHPParserError
Less than 1 minute
PHPParserError
Exception thrown when a PHP parsing error occurs.
class PHPParserError extends \Hazaar\Parser\Exception\ExceptionThis exception is used to indicate that an error occurred during PHP parsing, providing the source file where the error was detected. Optionally, a previous exception and error code can be included for chaining and error handling.
Properties
sourceFile
The path to the source file where the error occurred.
private string $sourceFileMethods
__construct
Constructs a new PHPParserError exception.
public __construct(string $sourceFile, ?\Throwable $previous, int $code = 500): voidParameters
| Parameter | Type | Description |
|---|---|---|
$sourceFile | string | the path to the source file where the error occurred |
$previous | \Throwable | optional previous exception for chaining |
$code | int | the error code (default 500) |
__toString
Returns the exception message as a string.
public __toString(): stringIf a previous exception exists, its message is appended to the current exception message.
getSourceFile
Gets the path to the source file where the error occurred.
public getSourceFile(): stringGenerated by Hazaar API Doc Generator on Tue, 21 Apr 2026 04:00:25 +0000