downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Exception::getTrace> <Exception::getFile
Last updated: Fri, 06 Nov 2009

view this page in

Exception::getLine

(PHP 5 >= 5.1.0)

Exception::getLineObté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 contém 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 a:

The exception was thrown on line: 3



add a note add a note User Contributed Notes
Exception::getLine
There are no user contributed notes for this page.

Exception::getTrace> <Exception::getFile
Last updated: Fri, 06 Nov 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites