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, 20 Nov 2009

view this page in

Exception::getLine

(PHP 5 >= 5.1.0)

Exception::getLineGets the line in which the exception occurred

Description

final public int Exception::getLine ( void )

Returns line number where the exception was thrown.

Parameters

This function has no parameters.

Return Values

Returns the line number where the exception was thrown.

Examples

Example #1 Exception::getLine() example

<?php
try {
    throw new 
Exception("Some error message");
} catch(
Exception $e) {
    echo 
"The exception was thrown on line: " $e->getLine();
}
?>

The above example will output something similar to:

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, 20 Nov 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites