Exception::getLine

(PHP 5, PHP 7)

Exception::getLine锟斤拷取锟斤拷锟斤拷锟斤拷锟届常锟斤拷锟斤拷锟侥硷拷锟叫碉拷锟叫猴拷

说锟斤拷

final public Exception::getLine ( void ) : int

锟斤拷锟截凤拷锟斤拷锟届常锟侥达拷锟斤拷锟斤拷锟侥硷拷锟叫碉拷锟叫号★拷

锟斤拷锟斤拷

锟剿猴拷锟斤拷没锟叫诧拷锟斤拷锟斤拷

锟斤拷锟斤拷值

锟斤拷锟截凤拷锟斤拷锟届常锟侥达拷锟斤拷锟斤拷锟侥硷拷锟叫碉拷锟叫号★拷

锟斤拷锟斤拷

Example #1 Exception::getLine()示锟斤拷

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

锟斤拷锟斤拷锟斤拷锟教碉拷锟斤拷锟斤拷锟斤拷锟斤拷冢锟�

The exception was thrown on line: 3

锟轿硷拷

  • Throwable::getLine()