Note that it appears to be the line number the Exception was created that is returned, *not* the line it was thrown from.
See this bug:
http://bugs.php.net/bug.php?id=53882
Wanted to note that here until documentation is fixed or bug report dealt with.
Exception::getLine
(PHP 5 >= 5.1.0)
Exception::getLine — Obtém a linha na qual a exceção ocorreu
Descrição
final public string Exception::getLine
( void
)
Retorna o número da linha onde a exceção foi disparada.
Parâmetros
Esta função não possui parâmetros.
Valor Retornado
Retorna o número da linha onde a exceção foi disparada.
Exemplos
Exemplo #1 Exemplo da Exception::getLine()
<?php
try {
throw new Exception("Some error message");
} catch(Exception $e) {
echo "The exception was thrown on line: " . $e->getLine();
}
?>
O exemplo acima irá imprimir algo similar à:
The exception was thrown on line: 3
