Lisphp_ParsingException::getLisphpLine PHP Method

getLisphpLine() public method

public getLisphpLine ( )
    public function getLisphpLine()
    {
        if ($this->offset <= 0) {
            return 1;
        }
        return substr_count($this->code, "\n", 0, $this->offset) + 1;
    }

Usage Example

Exemplo n.º 1
0
function Lisphp_printParsingError(Lisphp_ParsingException $e)
{
    echo $e->getMessage(), "\n";
    $lines = explode("\n", $e->code);
    echo $lines[$e->getLisphpLine() - 1], "\n";
    echo str_repeat(' ', $e->getLisphpColumn() - 1), "^\n";
}
All Usage Examples Of Lisphp_ParsingException::getLisphpLine